summaryrefslogtreecommitdiff
path: root/six.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2015-03-20 10:23:50 -0500
committerBenjamin Peterson <benjamin@python.org>2015-03-20 10:23:50 -0500
commitb4731b67a14d213cdbf73eade1412a60b64bd911 (patch)
tree2d9d657ddb23e3143f6cbc2e1f4c9acccba5cc1b /six.py
parent185a7e536357cee2227e432c6e37093ec21e01af (diff)
parentc7909fab088b97ced9ea153e6b9d324c9e3a9c43 (diff)
downloadsix-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.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/six.py b/six.py
index 5e969d3..618c641 100644
--- a/six.py
+++ b/six.py
@@ -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):