what does 'a=b=c=[]' do

Steven D'Aprano steve+comp.lang.python at pearwood.info
Fri Dec 23 04:39:59 EST 2011


On Fri, 23 Dec 2011 00:38:07 -0800, rusi wrote:

> Likewise function arguments that default to mutable entities is a known
> gotcha of python which is best treated as a bug in python.

Nonsense. It is a feature, not a bug.

Some people might argue that it is a mistake, a minor feature which 
allegedly causes more difficulties than benefits. I do not hold with that 
idea. But either way, it is not a bug to be fixed, but a deliberate 
consequence of intended semantics.



-- 
Steven



More information about the Python-list mailing list