-
Notifications
You must be signed in to change notification settings - Fork 76
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Since 8.5.6+, an attempt to call class_schema on a class that cannot be converted by marschmallow_dataclass throws AttributeError. Previously it was a TypeError which is somehow meaningful because the type is not convertible.
Example:
from marshmallow_dataclass import class_schema
from typing import Callable
class NonDataClass:
f: Callable[[str, str], int]
class_schema(NonDataClass)
Expected (was in versions up to 8.5.5):
throws TypeError as
TypeError: typing.Callable[[str, str], int] is not a dataclass and cannot be turned into one.
Actual (version 8.5.6, 8.5.7, 8.5.8):
...
File "venv/lib/python3.9/site-packages/marshmallow_dataclass/__init__.py", line 367, in _internal_class_schema
_RECURSION_GUARD.seen_classes[clazz] = clazz.__name__
File ".pyenv/versions/3.9.9/lib/python3.9/typing.py", line 710, in __getattr__
raise AttributeError(attr)
AttributeError: __name__
lovasoa, miketheman and atugushev
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working