From 79177bac31ef913b2dd739ceea349818e7afb7b6 Mon Sep 17 00:00:00 2001 From: Ritvik Nag Date: Fri, 22 Nov 2024 22:40:44 -0500 Subject: [PATCH] Fix for Python 3.9-3.11 --- dataclass_wizard/models.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/dataclass_wizard/models.py b/dataclass_wizard/models.py index 2aa60d5f..99e2f7cd 100644 --- a/dataclass_wizard/models.py +++ b/dataclass_wizard/models.py @@ -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):