[Python-Dev] Re: new syntax for wrapping (PEP 318)

Anders J. Munch andersjm at dancontrol.dk
Fri Feb 27 08:23:10 EST 2004


From: "Paul Svensson" <paul-python at svensson.org>
> "Delaney, Timothy C (Timothy)" <tdelaney at avaya.com> writes:
> 
> >     +0 on def foo (bar) as baz: if there's a way to extend it multi-line.
> 
> Thinking of the proposed change to allow parentheses with import, how about:
> 
>     def foo(bar) as baz, gazonk: pass
> 
>     def foo(bar) as (baz, gazonk): pass
> 
>     def foo(bar) as (baz,
>                      gazonk): pass

Unlike import, we are dealing will full-blown expressions here, not
just single identifiers, so you'd have to figure out how to deal with
e.g.:

  def foo(bar) as (baz), gazonk: pass # legal?

A variation with cleaner implementation: Let the decorator-list be a
single expression. If that expression evaluates to a tuple, treat it
like a sequence of decorator functions. If not, treat it like a single
decorator.

+1 on def foo(bar) as baz
+0 on def foo(bar)[baz]


- Anders





More information about the Python-Dev mailing list