Re:Goto decorator for python
by anonymoushn on Sunday March 11, 2012 @07:55PM
(#3691700)
For what value of __mull__ and __add__ does f(g(x)) produce a different result than h(x)? You could do this by making __mul__ or __add__ change behavior based on stack inspection, but I am having trouble thinking of another way.
[ Parent
| on HN ]
Re:Goto decorator for python
by alextgordon on Sunday March 11, 2012 @09:07PM
(#3691898)
A backtrace would be different, for a start. If __mul__ raises an exception, it would not show as coming from g(). Makes debugging a little bit harder.