We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 19a1641 commit dd8445fCopy full SHA for dd8445f
src/cattr/converters.py
@@ -82,9 +82,7 @@ def is_optional(typ):
82
83
84
def is_literal_containing_enums(typ):
85
- return is_literal(typ) and any(
86
- isinstance(val, Enum) for val in typ.__args__
87
- )
+ return is_literal(typ) and any(isinstance(val, Enum) for val in typ.__args__)
88
89
90
class Converter:
@@ -389,9 +387,7 @@ def _structure_simple_literal(val, type):
389
387
390
388
@staticmethod
391
def _structure_enum_literal(val, type):
392
- vals = {
393
- (x.value if isinstance(x, Enum) else x): x for x in type.__args__
394
- }
+ vals = {(x.value if isinstance(x, Enum) else x): x for x in type.__args__}
395
try:
396
return vals[val]
397
except KeyError:
0 commit comments