Skip to content

Commit

Permalink
Fix for Python 3.9-3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
rnag committed Nov 23, 2024
1 parent 6d0951b commit 79177ba
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions dataclass_wizard/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,11 @@
# The `type` statement is introduced in Python 3.12
# Ref: https://docs.python.org/3.12/reference/simple_stmts.html#type
#
# TODO: Remove function declaration once we drop support
# for Python 3.9-3.11
def get_catch_all():
if PY312_OR_ABOVE:
type CatchAll = Mapping
return CatchAll
else:
return NewType('CatchAll', Mapping)


CatchAll = get_catch_all()
# TODO: uncomment following usage of `type` statement
# once we drop support for Python 3.9 - 3.11
# if PY312_OR_ABOVE:
# type CatchAll = Mapping
CatchAll = NewType('CatchAll', Mapping)


class Extras(PyTypedDict):
Expand Down

0 comments on commit 79177ba

Please sign in to comment.