Created
October 13, 2014 07:54
-
-
Save zachriggle/a363d271b29ab5943f64 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> class A(object): pass | |
... | |
>>> a = A() | |
>>> a.__len__ = lambda: 3 | |
>>> a.__len__() | |
3 | |
>>> len(a) | |
Traceback (most recent call last): | |
... | |
TypeError: object of type 'A' has no len() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment