In http://mail.python.org/pipermail/python-dev/2006-June/066399.html, PJE wrote: >> Python prefers to evaluate expressions in the order that they >> appear in source code, ... "first-time use" preserves that >> property; "function definition time" does not.
Guido wrote: > But first-time has the very big disadvantage IMO that there's no > safeguard to warn you that the value is different on a subsequent > execution -- you just get the old value without warning. That is true either way, and is already true with computed default arguments. The only difference is that your mental model has even longer to become inconsistent. (The time between definition and first use.) First time use also lets you use a constant (such as a dotted name from another module) that may not yet be defined when the function is defined, but will be defined before the function is used. -jJ _______________________________________________ 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