We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
has_fields
AttributeError: __mro__
typing.Union
from typing import Union from pyfields import has_fields has_fields(Union[int, float])
Leads to a non-user-friendly error message:
Traceback (most recent call last): ... File "<ipython-input-4-0e8bf0e2111b>", line 1, in <module> has_fields(Union[int, float]) File "\site-packages\pyfields\helpers.py", line 146, in has_fields return any(yield_fields(cls, include_inherited=include_inherited)) File "\site-packages\pyfields\helpers.py", line 71, in yield_fields where_cls = reversed(getmro(cls)) if ancestors_first else getmro(cls) File "C:\Python38\lib\inspect.py", line 489, in getmro return cls.__mro__ File "C:\Python38\lib\typing.py", line 760, in __getattr__ raise AttributeError(attr) AttributeError: __mro__
We should rather return None or raise a proper ValueError indicating that cls is not an actual class.
None
ValueError
cls
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Leads to a non-user-friendly error message:
We should rather return
None
or raise a properValueError
indicating thatcls
is not an actual class.The text was updated successfully, but these errors were encountered: