alternate function call syntax (was: print - parameters ?)

Helmut Jarausch jarausch at igpm.rwth-aachen.de
Wed Oct 6 11:08:29 CEST 2004


Alex Martelli wrote:
.....
> It's not really a "sort of thing", alas... print is a statement so it
> lives by its own rules (a Python wart, Guido's admitted that; maybe it
> will change in Python 3000... let's hope!).

Is there any chance that Python 3000 would allow an alternate function call
in addition to the standard function call
I'd suggest something along the lines of a TeX macro definition, e.g.

def integrate(x,y,z) accepts function 'from' float 'to' float

this must then be called as

from math import sin
....
integrate sin from 0.0 to 3.14

Note, the keywords 'from' and 'to' must be present.

It would still be possible to called it as
integrate(sin,0.0,3.14)

the general rule would be
def <function_name>(<argument_list>) accepts <type> ([<keyword-string>] <type>)*

Then 'print' could just be a standard function.

Helmut.

-- 
Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany



More information about the Python-list mailing list