[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 21:34:32 EST 2004


On Wed, Mar 10, 2004, Fred L. Drake, Jr. wrote:

On Wednesday 10 March 2004 08:43 pm, Aahz wrote:

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. My first reaction to this was "Since when??!?" If the only descriptors you're thinking about are things that return callables from the get() method, it makes sense that you've made this mistake. What needs to be considered though is that not all descriptors provide callable results. Remember that "property" is a descriptor type; instances of property are not normally callable.

"They" was referring to Greg's mention of classmethods and staticmethods. Despite the example given of the colormap, it's still not clear to me what the use case is for a decorator returning an object that doesn't get used as a callable, particularly when weighed against the disadvantages.

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