Default Value

Rick Johnson rantingrickjohnson at gmail.com
Fri Jun 21 21:42:32 EDT 2013


On Friday, June 21, 2013 8:31:35 PM UTC-5, Steven D'Aprano wrote:
> Tuples have to go into the "Bad List" because, although
> they themselves are immutable, their contents may not be.
> Imagine the confusion and horror that poor developers will
> experience when they do something like this:
> 
> def func(arg, extra=(23, 'foo', [])):
>     [code goes here...]
>     extra[2].append("something")
>     [more code...]
>
> and they've now mutated the immutable default! Thinking
> about this, I think that the only safe thing to do in
> Rickython 4000 is to prohibit putting mutable objects
> inside tuples. Putting a list or a dict inside a tuple is
> just a bug waiting to happen!

Geezsus, the warts in this language are innumerable! 

So what your saying is that Python Tuples are "immutable"
like automobiles passengers are "immutable". Sure you can
design the car for a maximum number of passengers, but as
soon as the circus clowns show up, all bets are off!

This whole language is a joke! It just some sick joke! ROTF



More information about the Python-list mailing list