
Aug. 30, 2012
4:28 a.m.
On Wed, Aug 29, 2012 at 03:48:01PM -0700, Guido van Rossum wrote:
There's a concept that's sometimes useful when explaining behavior of certain Python operations in terms of simpler ones, and it is "does the class of x define a method m?".
It's not just methods where this is useful. For example, the help() quasi-builtin ignores instance attribute x.__doc__ and instead uses type(x).__doc__. I'm not sure that needing this is common enough to justify builtins, but I think it would be useful to have hastypeattr and friends (get*, set* and del*) in the operator module. -- Steven