A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2003-January/032358.html below:

[Python-Dev] Extended Function syntax

[Python-Dev] Extended Function syntaxJust van Rossum just@letterror.com
Thu, 23 Jan 2003 09:44:44 +0100
Jim Fulton wrote:

> In particular:
> 
>    def name(arg, ...) [expr1, expr2, expr3]:
>        ...body...
> 
> would be equivalent to (some variation on):
> 
>    def name(arg, ...):
>      ...body...
> 
>    name=expr1(expr2(expr3(name)))

With Michael's patch (which indeed still works) it's actually 

    name = expr3(expr2(expr1(name)))

> I wonder if the same mechanism could be used in class statements.
> If I had this, I might say what interface a class implements
> with:
> 
>    class foo(spam, eggs) [implements(IFoo, IBar)]:
>       body of class
> 
> or (wo parens):
> 
>    class foo [implements(IFoo, IBar)]:
>       body of class

I don't know how Zope interfaces work, but I can imagine the following
could be made to work as well:

   class foo(spam, eggs) [IFoo, IBar]:
      body of class

I think this would be wonderful. Would someone be interested in
extending Michael's patch to also cover the class statement?

Just



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4