Ian Bicking wrote:
> I know *I* at least don't like code that mixes up access and 
> modification.  Maybe not everyone does (or maybe not everyone thinks of 
> getitem as "access", but that's unlikely).  I will assert that it is 
> Pythonic to keep access and modification separate, which is why methods 
> and attributes are different things, and why assignment is not an 
> expression, and why functions with side effects typically return None, 
> or have names that are very explicit about the side effect, with names 
> containing command verbs like "update" or "set".  All of these 
> distinguish access from modification.

Do you never write

 d[some_key].append(some_value)

This is modification and access, all in a single statement, and all
without assignment operator.

I don't see the setting of the default value as a modification.
The default value has been there, all the time. It only is incarnated
lazily.

Regards,
Martin
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to