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.
I can find no reason why this should be interpreted as int.
dev_modeisboolandignore_environmentisint. Thenotwill convert theintto abool, as correctly inferred in the first example.Code from here: https://github.com/aio-libs/aiohttp/pull/6549/files#diff-b797dd8733928df191ba2061121ab8b69976c185fcbfad4534891d3252b9ac30R84