bloomberg / attrs-strict

Provides runtime validation of attributes specified in Python 'attr'-based data classes.
Apache License 2.0
52 stars 19 forks source link

Fix `is_newtype()` check #36

Closed saytosid closed 4 years ago

saytosid commented 4 years ago

*Issue number of the reported bug or feature request: #35

Describe your changes Changed is_newtype() to check for existence of __supertype__ .

I couldn't find a documented way to check for isinstance(_, NewType). After looking at the implementation, this should be enough.