tl_news at nexgo.de
Thu Jul 31 19:13:56 CEST 2003
On 31 Jul 2003 18:01:51 +0100, jjl at pobox.com (John J. Lee) wrote:
>Because that's the way Python always does function calls?
Of course. From the consistency point of view... perfectly right!
(I thought that maybe because these are very special low-level methods
for built-in types, it might be different....)
>Don't, then. :-) Use key in dict, or dict.has_key(key).
or the C-like style:
>>> a = a.get(1) or b.setdefault(4,1)
More information about the Python-list