On Sun, Sep 28, 2003 at 12:59:52PM -0700, Steve Fink wrote: > I don't know whether Perl6 or any other language we want to be nice to > has *non-constant* defaults. If so, and if we want direct support for > them, then it means we need to evaluate them in the context of the > callee.
Depends on what you mean by 'non-constant', i suppose. Python default args can be mutable objects, but they are only evaluated once, at function definition time. So you can have a function with an empty list as a default argument, and each call may append to the list. Whether this is a bug or a feature may be debatable; Python programmers tend to frown on such Clever Hacks.
signature.asc
Description: Digital signature