Hacker News new | ask | show | jobs
by aeturnum 59 days ago
I can't provide any code samples, but this only strikes me as medium-cursed as far as python code goes. That stuff can get nasty! Once a team realizes they can modify anything at runtime things can go bad quite quickly.

Nice hack for maintaining old behavior tho!

1 comments

For Python in general, stack walking ranks medium-cursed. A frame inspection can even be used for good: namedtuple from the stdlib IIRC uses it when building the class. What made Pendulum's example cursed IMHO is the fact that it's a mathematical operator, and it leaks out unintended behavior---like calling it depends on the caller's function name.