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
As an example I specifically need them in type/definition.py to correctly narrow down the types in a codegen tool. In the meantime I've reimplemented these functions:
I thought the isinstance would be enough for the type checker to infer in these cases but if the return type is bool in these functions they're not narrowed.
The text was updated successfully, but these errors were encountered:
Thanks for reminding me of this feature @helderco, we should definitely do that. Though it's only available since Python 3.10, it also can be used in earlier Python versions via typing-extensions.
As an example I specifically need them in
type/definition.py
to correctly narrow down the types in a codegen tool. In the meantime I've reimplemented these functions:I thought the
isinstance
would be enough for the type checker to infer in these cases but if the return type isbool
in these functions they're not narrowed.The text was updated successfully, but these errors were encountered: