[Python-Dev] Plea for function/method syntax sugar (PEP 318, with a different syntax)

Josiah Carlson jcarlson at uci.edu
Thu Feb 19 10:53:28 EST 2004

[Bob Ippolito]

> This evaluation order is Guido approved, though at least one person  
> wanted it to be the other way around

I can understand the desire to have it both ways.  That is, while it
makes sense to have functions applied in list-order, it also makes sense
to have the resulting function visually in the same order.

[snip some examples, a few from PyObjC]

From what I understand (please correct me if I am wrong), the entirety
of the PEP seeks to fix the situation where someone wants to alter a
defined function, the most common case (though I've never used it) in
making a methods class or static (or really instancemethod and function,
if we check types in Python 2.3).

Now, Bob brings this up in the context of PyObjC, and generating ':'
separated naming that PyObjC needs.  While I feel for him not wanting to
type, and even being pained to type so much, I've never needed to do the
sort of thing that the PEP or Bob offers, and don't know if it is a real
syntactic gain.  Certainly it makes convenient all of the examples that
the PEP and Bob offer, but again, is the syntax and functionality
necessarily clear?

Both the PEP and Bob offer that the order of invocation of the
'translations' could be reversed, and still make sense.  I think this is
an example of the syntax not being clear.

 - Josiah

More information about the Python-Dev mailing list