Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import communism
- class MyClass1:
- pass
- class MyClass2:
- pass
- print(MyClass1() == MyClass2())
- communism.revolution(globals())
- print(MyClass1() == MyClass2())
- # As all classes are equal (in __hash__ and in __eq__)
- # This is why you cannot put more than one object in any Set or Dict
- print(set([MyClass1(), MyClass2(), MyClass2()]))
- ## outputs
- # False
- # True
- # {<__main__.MyClass1 object at 0x7fc6c66b0fa0>}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement