Martin v. L=F6wis wrote: > Guido van Rossum <guido@python.org> writes: >=20 >=20 >>I think the final proposal looked like this: >> >> def name(arg, ...) [expr, ...]: >> ...body... >> >=20 >=20 > I don't think there was much discussion. The suggested semantics was > that this is equivalent to >=20 > def name(arg, ...): > ...body... > name=3Dexpr(name) > ... In particular: def name(arg, ...) [expr1, expr2, expr3]: ...body... would be equivalent to (some variation on): def name(arg, ...): ...body... name=3Dexpr1(expr2(expr3(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 Jim --=20 Jim Fulton mailto:jim@zope.com Python Powered! CTO (888) 344-4332 http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org
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