Mark Janssen <[email protected]> writes:
>>>>> def fact(n): return 1 if n <= 1 else n * fact(n-1)
>> class Strange:
>> ...
>> def __le__(dummy):
>> global fact
>> fact = someotherfun # this is "binding"
>> return false
>> You cannot prevent this in python.
> No, but you can't prevent a lot of bad moves in python. What you just
> did there is a total bonehead ("strange"?) of an idea.
I think allowing rebinding of function names is extremely strange, even
though it's easier to implement. I tend to agree with you on the quality
of the idea, but optimization has to take this into account (and give
up, usually).
-- Alain.
--
https://mail.python.org/mailman/listinfo/python-list