6
_HUGEINT = (sys.maxint + 1L) * 2L
9
# Copied from twisted.python.util.unsignedID
12
Return the id of an object as an unsigned number so that its hex
13
representation makes sense
21
# Copied from twisted.python.util.mergeFunctionMetadata.
22
def mergeFunctionMetadata(f, g):
24
Overwrite C{g}'s name and docstring with values from C{f}. Update
25
C{g}'s instance dictionary with C{f}'s.
27
To use this function safely you must use the return value. In Python 2.3,
28
L{mergeFunctionMetadata} will create a new function. In later versions of
29
Python, C{g} will be mutated and returned.
31
@return: A function that has C{g}'s behavior and metadata merged from
35
g.__name__ = f.__name__
38
merged = new.function(
39
g.func_code, g.func_globals,
40
f.__name__, inspect.getargspec(g)[-1],
47
merged.__doc__ = f.__doc__
48
except (TypeError, AttributeError):
51
merged.__dict__.update(g.__dict__)
52
merged.__dict__.update(f.__dict__)
53
except (TypeError, AttributeError):
55
merged.__module__ = f.__module__