summaryrefslogtreecommitdiff
path: root/six.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2013-04-19 14:30:53 -0400
committerBenjamin Peterson <benjamin@python.org>2013-04-19 14:30:53 -0400
commita47db2f576108590756b8e5360bf29b6f02a9ab0 (patch)
tree196ae8dd313013e3c02238cf7c46a7c29e729eaf /six.py
parent4895c1c7bb958d40f645f3a9106cf22d093f004e (diff)
downloadsix-a47db2f576108590756b8e5360bf29b6f02a9ab0.tar.gz
add create_bound_method
Diffstat (limited to 'six.py')
-rw-r--r--six.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/six.py b/six.py
index a315053..b833810 100644
--- a/six.py
+++ b/six.py
@@ -253,11 +253,16 @@ if PY3:
def get_unbound_function(unbound):
return unbound
+ create_bound_method = types.MethodType
+
Iterator = object
else:
def get_unbound_function(unbound):
return unbound.im_func
+ def create_bound_method(func, obj):
+ return types.MethodType(func, obj, obj.__class__)
+
class Iterator(object):
def next(self):