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
a: bool
b: int
reveal_type(a or not b) # Revealed type is "builtins.bool"
reveal_type(sys.flags.dev_mode or not sys.flags.ignore_environment) # Revealed type is "builtins.int"
I can find no reason why this should be interpreted as int. dev_mode is bool and ignore_environment is int. The not will convert the int to a bool, as correctly inferred in the first example.
sys.flags.dev_mode was previously incorrectly annotated as int in the typeshed stubs, but this has recently been corrected (python/typeshed#6816). The change has yet to be reflected in mypy, but should be fixed after the next typeshed sync.
Uh oh!
There was an error while loading. Please reload this page.
I can find no reason why this should be interpreted as int.
dev_mode
isbool
andignore_environment
isint
. Thenot
will convert theint
to abool
, as correctly inferred in the first example.Code from here: https://github.com/aio-libs/aiohttp/pull/6549/files#diff-b797dd8733928df191ba2061121ab8b69976c185fcbfad4534891d3252b9ac30R84
The text was updated successfully, but these errors were encountered: