The problem with "as" [was "Re: PEP 318"]

Paul Rubin http
Tue Mar 23 01:43:18 CET 2004

DH <no at> writes:
> Possible future Python example that uses "as" differently:
> def foo(x as int, y as float) as int:
>     "this function returns an integer, and takes an int & float params"

I think I'd rather use colons for that, like Pascal does, e.g.

  def foo:int (x: int, y: float)

hmm, the foo:int doesn't look too good.

> If we use the list syntax for decorators instead of "as", we might be
> able to do something like:
> def foo(x as int, y as float) [synchronized, classmethod] as int:

That's sort of nice.

More information about the Python-list mailing list