Default Value

Chris Angelico rosuav at gmail.com
Fri Jun 21 21:40:09 EDT 2013


On Sat, Jun 22, 2013 at 11:31 AM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> 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!

I think you're onto something here, but you really haven't gone far
enough. Mutable objects *anywhere* are a problem. The solution?
Abolish mutable objects. Strings (bytes and Unicode), integers,
decimals (floats are a problem to many people), tuples of the above,
and dictionaries mapping any of the above to any other of the above,
should be enough to do everything.

ChrisA



More information about the Python-list mailing list