why not extending the syntax for classes, too ?
pyth at devel.trillke.net
Sun Feb 9 23:23:52 CET 2003
Erik Max Francis wrote:
> 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
Ok, then we must call upon our modern oracle, Google. For
python "function as"
it returns 11000 hits and more than 27000 hits for
python "function is"
so 'is' wins by a clear lead :-)
More information about the Python-list