Created
July 28, 2015 11:49
-
-
Save draganHR/040cc7d0ea130b765c71 to your computer and use it in GitHub Desktop.
This file contains hidden or 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): | |
| def method(self): | |
| print "I'm method in A" | |
| def __method__(self): | |
| print "I'm __method__ in A" | |
| def __method(self): | |
| print "I'm __method in A" | |
| a = A() | |
| print hasattr(a, 'method') # True | |
| print hasattr(a, '__method__') # True | |
| print hasattr(a, '__method') # False | |
| print hasattr(a, '_A__method') # True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment