Skip to content

Commit

Permalink
Improve set handling on 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinche committed Jun 1, 2024
1 parent 17a8fd8 commit a2d6b0f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/cattrs/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,9 +504,10 @@ def is_deque(type: Any) -> bool:
or type.__origin__ is deque
)

def is_mutable_set(type):
return type is set or (
type.__class__ is _GenericAlias and is_subclass(type.__origin__, MutableSet)
def is_mutable_set(type) -> bool:
return type in (set, TypingAbstractSet) or (
type.__class__ is _GenericAlias
and is_subclass(type.__origin__, (MutableSet, TypingAbstractSet))
)

def is_frozenset(type):
Expand Down

0 comments on commit a2d6b0f

Please sign in to comment.