* Added python-level advanced hack module which should hide all my dirty
tricks here.
This commit is contained in:
17
hacks.py
Normal file
17
hacks.py
Normal file
@@ -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)
|
||||
Reference in New Issue
Block a user