Paul Rubin wrote:
"El Pitonero" <[EMAIL PROTECTED]> writes:

What about no name at all for the scalar case:

a['hello'] += 1
a['bye'] -= 2


I like this despite the minor surprise that it works even when
a['hello'] is uninitialized.
+1
and if the value is a list:
a['hello']= [1, 2, 3]
a['hello']+= [4]            # adding the brackets is a lot simpler than
                              typing append or extend.

Any user is free to add his/her own subclass to handle defaults.

Colin W.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to