[Python-Dev] itertools addition: getitem()

Georg Brandl g.brandl at gmx.net
Sun Jul 8 13:33:55 CEST 2007


Guido van Rossum schrieb:
> How important is it to have the default in this API? __getitem__()
> doesn't have a default; instead, there's a separate API get() that
> provides a default (and I find defaulting to None more manageable than
> the "_default = object()" pattern).

getattr() has a default too, while __getattr__ hasn't...

Georg

-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.



More information about the Python-Dev mailing list