Skip to content

Commit

Permalink
tests: Add test for "not" of a user defined class.
Browse files Browse the repository at this point in the history
  • Loading branch information
dpgeorge committed Dec 10, 2015
1 parent bdbe8c9 commit de2a2e2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/basics/unary_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,13 @@
print(not [1,])
print(not {})
print(not {1:1})

# check user instance
class A: pass
print(not A())

# check user instances derived from builtins
class B(int): pass
print(not B())
class C(list): pass
print(not C())

0 comments on commit de2a2e2

Please sign in to comment.