Trapping numeric operators
John Dell'Aquila
dellaq at ml1.net
Fri Oct 22 13:41:05 EDT 2004
More information about the Python-list mailing list
Fri Oct 22 13:41:05 EDT 2004
- Previous message (by thread): Latex2html conventor ?
- Next message (by thread): Trapping numeric operators
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
The lambda wrapper does impose the overhead of an extra function call:
classdict[magicName] = (
lambda self, other=None, name=magicName, op=op, fn=fn:
fn(self, other, name, op)
)
I could eliminate that by stubbing out the closure and inserting the
code block directly into it:
stub = lambda self, other=None, name=magicName, op=op: self
stub.func_code = fn.func_code
classdict[magicName] = stub
What do folks think -- useful trick or too squirrelly to countenance?
- Previous message (by thread): Latex2html conventor ?
- Next message (by thread): Trapping numeric operators
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list