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
classFoo:
@propertydefprop(self) ->bool:
returnFalsedefbools_only(value: bool) ->bool:
returnvaluebools_only(Foo().prop) # Standard behavior of propertiesbools_only(Foo.prop) # Expected type 'bool', got 'property' instead bools_only(notFoo.prop) # no error after casting with `not`!
Python interprets not object as not bool(object) which doesn't seem to be covered by any checks.
Python interprets
not object
asnot bool(object)
which doesn't seem to be covered by any checks.Tested with Mypy 1.11.2 and Python 3.12
https://mypy-play.net/?mypy=latest&python=3.12&gist=1c5f3510b686dd0e2e04e0a9ef191a96
The text was updated successfully, but these errors were encountered: