Skip to content

Commit de2a2e2

Browse files
committed
tests: Add test for "not" of a user defined class.
1 parent bdbe8c9 commit de2a2e2

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

tests/basics/unary_op.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,13 @@
1515
print(not [1,])
1616
print(not {})
1717
print(not {1:1})
18+
19+
# check user instance
20+
class A: pass
21+
print(not A())
22+
23+
# check user instances derived from builtins
24+
class B(int): pass
25+
print(not B())
26+
class C(list): pass
27+
print(not C())

0 commit comments

Comments
 (0)