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

Neil Cerutti neilc at norwich.edu
Fri Dec 23 08:10:53 EST 2011


On 2011-12-23, Chris Angelico <rosuav at gmail.com> wrote:
> On Fri, Dec 23, 2011 at 7:49 PM, Ethan Furman <ethan at stoneleaf.us> wrote:
>> That is the most ridiculous thing I have heard in a while.
>> ?Mutable default arguments are *not* a bug in Python.
>>
>> Reminds me of a bug report a couple years back claiming
>> multiple inheritence was a bug and asking it to be removed.
>
> Both of these could arguably be called misfeaures, but not
> bugs.

Is the misfeature that Python doesn't evaluate the default
argument expression every time you call the function? What would
be the harm if it did?

-- 
Neil Cerutti



More information about the Python-list mailing list