You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this could be fairly useful, especially if you're willing to do type checks beyond the "base type" such as checking the values of the keys in a dictionary.
Since attrs-strict already has the capability to do most of these checks, how about a derived library that simply provides an alternative isinstance that works with both python types and types provided in the typing module ?
Additionally (this might already exist) it could provide a decorator for functions that checks if the passed arguments are valid based on the types specified in the function declaration.
The text was updated successfully, but these errors were encountered:
Currently, the
isinstance
check doesn't work with anything existing in the typing module.For example, you can't do the following:
I think this could be fairly useful, especially if you're willing to do type checks beyond the "base type" such as checking the values of the keys in a dictionary.
Since
attrs-strict
already has the capability to do most of these checks, how about a derived library that simply provides an alternativeisinstance
that works with both python types and types provided in the typing module ?Additionally (this might already exist) it could provide a decorator for functions that checks if the passed arguments are valid based on the types specified in the function declaration.
The text was updated successfully, but these errors were encountered: