forked from python-attrs/cattrs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix __parameters__ access in gen._generate_mapping
There are Generic types in the typing modules from which you can inherit in your own classes which do not have an __parameters__ attribute, such classes are now ignored making gen._generate_mapping effectively a no-op in case the class do not have an __parameters__ attribute. As https://github.com/ilevkivskyi/typing_inspect/blob/8f6aa2075ba448ab322def454137e7c59b9b302d/typing_inspect.py#L405 is showing there are also cases where __parameters__ could be None, so I test for both cases, that it is None or that it does not exist. See Also: python-attrs#217
- Loading branch information
Showing
2 changed files
with
72 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters