My tools of the trade for python programming.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

17 lines
393 B

#
# $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)