Created
April 29, 2010 16:33
-
-
Save ianb/383855 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
## Descriptors | |
## Anything with __get__ and __set__: | |
class classinstancemethod(object): | |
def __init__(self, func): | |
self.func = func | |
def __get__(self, obj, type=None): | |
def repl(*args, **kw): | |
return self.func(obj, type, *args, **kw) | |
return repl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment