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

Paul Rubin http
Mon Mar 22 19:43:18 EST 2004


DH <no at sp.am> 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