Skip to content

Commit bcaa4c9

Browse files
committed
Add reveal_types
1 parent 427987c commit bcaa4c9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test-data/unit/check-classes.test

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,8 +495,15 @@ class bool(int):
495495
def __new__(cls, __o: object):
496496
pass
497497

498+
class Falsey:
499+
def __bool__(self) -> Literal[False]: pass
500+
501+
reveal_type(bool(Falsey())) # N: Revealed type is "Literal[False]"
502+
498503
class int:
499504
def __new__(cls) -> Literal[0]: pass
505+
506+
reveal_type(int()) # N: Revealed type is "Literal[0]"
500507
[typing fixtures/typing-medium.pyi]
501508

502509
[case testOverride__new__WithLiteralReturnFailing]

0 commit comments

Comments
 (0)