From 1bbaae135fe99f924973e0b8e7341f8be422ba14 Mon Sep 17 00:00:00 2001 From: wirawan Date: Fri, 3 Jun 2011 21:31:59 +0000 Subject: [PATCH] * Added python-level advanced hack module which should hide all my dirty tricks here. --- hacks.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 hacks.py diff --git a/hacks.py b/hacks.py new file mode 100644 index 0000000..62e7c29 --- /dev/null +++ b/hacks.py @@ -0,0 +1,17 @@ +# +# $Id: hacks.py,v 1.1 2011-06-03 21:31:59 wirawan Exp $ +# +# Created: 20110603 +# Wirawan Purwanto +# +# Low-level python hacks to allow smooth operation of python +# codes. +# +# +import sys +import new + +def make_unbound_instance_method(method): + """Generates an unbound instance method from a possibly bound + instance method.""" + return new.instancemethod(method.im_func, None, method.im_class)