why not extending the syntax for classes, too ?

Erik Max Francis max at alcyone.com
Sun Feb 9 16:52:21 EST 2003


Michele Simionato wrote:

> Erik, I would concede you that there is the possibility of confusion
> between
> 
> def A is B:
>    pass
> 
> and
> 
> if A is B: do_something()
> 
> since in the first case "A is B" means "A is an instance of the
> descriptor B"
> whereas in the second case "A is B" means "A is the descriptor B".

Which is still why I think "as" would be preferable, since "as"
inherently means nothing (it's an auxiliary keyword), and "as" even has
a better (to me) implication here, when I write

	def f(x) as staticmethod: ...

I'm indicating staticmethod as a sort of property (not in the Python
"properties" sense) of the function, rather than the potential is-a
relationship suggested by the use of "is."

As I said in an earlier message, I'm not extremely forceful about it, I
just think "as" works a little better than "is."

> Moreover, who is the typical user who is going to use the extended
> syntax?

Agreed.  It is a fairly marginal point, but still I think "as" wins out
on its own merits.  Judgement call, and I'm willing to agree to
disagree.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ Life is an effort that deserves a better cause.
\__/ Karl Kraus
    Alcyone Systems / http://www.alcyone.com/
 Alcyone Systems, San Jose, California.




More information about the Python-list mailing list