default behavior

John Posner jjposner at optimum.net
Fri Aug 6 19:29:22 EDT 2010


On 8/6/2010 6:24 PM, Wolfram Hinderer wrote:
>
> This is probably nitpicking, but the patch calls __missing__ a special
> method. However, unlike special methods, it is not invoked by "special
> syntax" but by the dict's __getitem__ method. (len() invokes __len__
> on any object - you can't do something similar with __missing__.)
>
> __missing__ is also not listed as a special method on
> http://docs.python.org/py3k/reference/datamodel.html#special-method-names
>
> However, "normal" special method lookup seems to be used.

Fair enough. Please add your comment to #9536 at bugs.python.org.

Tx,
John



More information about the Python-list mailing list