Created
June 27, 2014 20:06
-
-
Save andrewgodwin/064b7b5d1adf6e8533b3 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 X: | |
@staticmethod | |
def y(self): | |
return 3 | |
z = [y] | |
>>> X.y | |
<function X.y at 0x7fc5e5ca90d0> | |
>>> X.z[0] | |
<staticmethod object at 0x7fc5e5ca26a0> | |
>>> X.y() | |
3 | |
>>> X.z[0]() | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
TypeError: 'staticmethod' object is not callable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment