diff options
author | Benjamin Peterson <benjamin@python.org> | 2015-03-20 10:23:50 -0500 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2015-03-20 10:23:50 -0500 |
commit | b4731b67a14d213cdbf73eade1412a60b64bd911 (patch) | |
tree | 2d9d657ddb23e3143f6cbc2e1f4c9acccba5cc1b /six.py | |
parent | 185a7e536357cee2227e432c6e37093ec21e01af (diff) | |
parent | c7909fab088b97ced9ea153e6b9d324c9e3a9c43 (diff) | |
download | six-git-b4731b67a14d213cdbf73eade1412a60b64bd911.tar.gz |
Merged in bartvm/six/create_unbound_method (pull request #64)
Introduces a wrapper to create unbound methods.
Diffstat (limited to 'six.py')
-rw-r--r-- | six.py | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -531,6 +531,9 @@ if PY3: create_bound_method = types.MethodType + def create_unbound_method(func, cls): + return func + Iterator = object else: def get_unbound_function(unbound): @@ -539,6 +542,9 @@ else: def create_bound_method(func, obj): return types.MethodType(func, obj, obj.__class__) + def create_unbound_method(func, cls): + return types.MethodType(func, None, cls) + class Iterator(object): def next(self): |