Mike Klaas wrote:
Another thing to consider is that the def() pattern is only possible
when the bound variable has no dots. A common pattern for me is to
replace an instances method with a lambda to add monitoring hooks or
disable certain functionality:
inst.get_foo = lambda: FakeFoo()
Good point. That one may write eg
for inst.bar in range(10) : do_something()
makes one wonder whether
def inst.bar(...) : ...
or even
def fn[k](...) : ...
should be similarly permitted. Has this ever been discussed ?
Regards, BB
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com