
On 1/30/07, Piotr Duda <duda.piotr@gmail.com> wrote:
I think that this problem can be solved by the following change of default argument behavior: default arguments are evaluated in definition time (like in current implementation), but right after being evaluated, result object is checked if it's mutable (for example by checking of presence __copy__ special method or being instance of built in (sub)class list/dict/set)
(snipped)
AFAIK there's no reliable way of deciding whether an arbitrary object is mutable or not, so the rest of the post is irrelevant. Besides, mutable default arguments is just a specific use case; the general problem discussed here is call-time vs definition-time semantics for arbitrary default argument expressions (function calls, attribute lookups, etc.). George