side effects on *some* default parameters

Joe Grossberg jgrossberg at matrixgroup.net
Wed Feb 12 16:43:34 EST 2003


>
>
>On Wed, Feb 12, 2003 at 04:21:57PM -0500, Joe Grossberg wrote:
>  
>
>>I was tripped up by this quirk of Python, and I was wondering if you 
>>guys could provide some insight.
>>
>>    
>>
>
>  http://www.python.org/doc/tut/node6.html
>
>  Jp
>
>
>  
>
Thx -- I understand that Python does this, and I'm glad to see it's 
documented. What I'm asking is *why* the language does this -- i.e. what 
is the rationale for evaluating default arguments only once, especially 
if it merited an "important warning"?

Joe

-- 
----------------------------------------------------------
Joe Grossberg :: Programmer :: jgrossberg at matrixgroup.net
http://www.matrixmaxx.net/ :: Custom Web Solutions and 
Web-Based Association Management Software.







More information about the Python-list mailing list