A RetroSearch Logo

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

Search Query:

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

[Python-Dev] Extended Function syntax

[Python-Dev] Extended Function syntaxM.-A. Lemburg mal@lemburg.com
Thu, 23 Jan 2003 17:12:22 +0100
Guido van Rossum 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 can't remember if that was deliberate or accidental.  I think
>>deliberate.
> 
> 
> It certainly surprises me less -- this is left-to-right (applying
> expr1 first) which is goodness.

+1

I suppose the following would also be possible, provided
that types(...) returns a callable, right ?

def myfunc(x,y,z) [types(int, int, float), cacheglobals]:
     return math.sin(x*y/z)

.... and cacheglobals would be able to rewrite the byte
code too. Nice :-)

-- 
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
_______________________________________________________________________
eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,...
Python Consulting:                               http://www.egenix.com/
Python Software:                    http://www.egenix.com/files/python/




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