PEP 318 - Function Modifier Syntax

Erik Max Francis max at alcyone.com
Tue Jun 10 23:57:24 CEST 2003


Jonathan Claggett wrote:

> How about overloading the keyword "is" instead of "as"? As far as
> English readability is concerned, this might be clearer. "Is" also
> fits in well with established OO terminology (e.g., a square is a
> rhombus, a function is a static method).

Deja vu.  The benefit, as I see it, is that `as' is a secondary keyword
-- it presently only has meaning in conjunction with an 'import'
statement.  Since it's a lowly little preposition, it doesn't have all
that much intrinsic meaning by itself.  If adding keywords were "free,"
perhaps some new word might be helpful, such as `has'.  But there is
significant inertia against adding new keywords, so if we can make do
with old ones, so much the better.  I personally think that `as' is a
very good choice for this because of its secondary nature.

The problem with using `is' is that it already has a very specific
meaning, namely in the use of the `is' operator.  

> Using "is" here could even conceivably lend itself to using the "is"
> expression to determine the qualities of a method.
> 
> example:
>     if func is staticmethod: print "it's static"

While I don't think that `is' is a particularly good choice for the job,
simultaneously doubling up meaning for the keyword and extending and
ambiguiating the meaning of the already-existing `is' operator seems
like a painfully bad idea to me.

-- 
   Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
 __ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/  \ I'm spreading my wings and I fly / I'm still as the night
\__/  Chante Moore




More information about the Python-list mailing list