Marco Mariani wrote:
Scott David Daniels wrote:
I am afraid it will make it too easy to define functions in other
modules remotely, a tempting sharp stick to poke your eye out with.
Imagine debugging a pile of code that includes a module with:
import random
def random.random():
return .42
No need to imagine. I can do the same, one line shorter:
>>> import random
>>> random.random = lambda: .42
I'm pointing out that that one is called lambda, so function.__name__
works out nicely. Similarly (and to my min more treacherously), the
def a.b(...):
...
doesn't give you a good clue about where to look for the definition.
That's all, not "monkeypatching is evil", but "monkeypatching should
stand out visually."
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list