[Python-Dev] PEP 318 restrictions on elements (original) (raw)

[Python-Dev] PEP 318 - generality of list; restrictions on elements

Aahz aahz at pythoncraft.com
Wed Mar 10 20:43:20 EST 2004


On Thu, Mar 11, 2004, Greg Ewing wrote:

Aahz <aahz at pythoncraft.com>:

Maybe I'm misunderstanding something. I thought that a property contains a get descriptor, which makes it a kind of callable. A property is a descriptor which contains up to 3 callables (for get, set, del), but descriptors themselves are not callable. This is one reason we can't require the result of a decorator to be callable. That would immediately rule out classmethod and staticmethod, which return descriptors, not callables!

That's why I said "kind of callable"; from the user's POV, they act like callables because you invoke them with call syntax, just like methods. As I noted, I'm not sure it's even possible to enforce that kind of restriction, but I think it's desirable to document. Guido has pronounced, so it's a dead issue, though.

Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/

"Do not taunt happy fun for loops. Do not change lists you are looping over." --Remco Gerlich, comp.lang.python



More information about the Python-Dev mailing list