Late-binding of function defaults (was Re: What is a function parameter =[] for?)

Gregory Ewing greg.ewing at canterbury.ac.nz
Thu Nov 26 16:20:57 EST 2015


Marko Rauhamaa wrote:
> What I'm saying is that Python does not prevent mutable keys but tries
> to do that with lists and tuples.
> 
> I think Python should stop trying.

Do you volunteer to answer all the posts from beginners
complaining that "the dict type is broken" because they
used a list as a key and then mutated it?

-- 
Greg



More information about the Python-list mailing list