Created
April 26, 2012 11:46
-
-
Save JoergWMittag/2499065 to your computer and use it in GitHub Desktop.
Python does have open classes
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): | |
def p(__self__): | |
print("1") | |
a = A() | |
a.p() | |
def p2(__self__): | |
print("2") | |
A.p = p2 | |
a.p() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment