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
There is already some disparity between naturally literal bools(annotated with Literal or narrowed) and artificially literal bools (platform, python-version, always-true, TYPE_CHECKING etc):
# mypy: always-true=foofromtypingimportLiteralfoo: boolifnotfoo:
print(1) # no error ✅bar: Literal[True]
ifnotbar:
print(1) # error: Statement is unreachable ✅
But this is not currently being applied to this situation:
KotlinIsland
changed the title
(🎁) Consider artificially literal bools when performing reachability checks
(🐞) Artificially literal bools not consider when performing reachability checks where branch terminates
Mar 17, 2022
KotlinIsland
changed the title
(🐞) Artificially literal bools not consider when performing reachability checks where branch terminates
(🐞) Artificially literal bools not considered when performing reachability checks where branch terminates
Mar 17, 2022
There is already some disparity between naturally literal bools(annotated with
Literal
or narrowed) and artificially literal bools (platform
,python-version
,always-true
,TYPE_CHECKING
etc):But this is not currently being applied to this situation:
Key:
✅ = correct behavior
❌ = sussy imposter behavior
Careful of #12325
Related: #11364
The text was updated successfully, but these errors were encountered: