Syntax suggestion.

samir samirbenabid at linuxmail.org
Mon Sep 4 06:25:45 EDT 2006


Alex Martelli wrote:
> What a mess it would be to disambiguate statements such as
>
> x = foo bar baz bat
>
> is it x = (foo, bar, baz, bat)
> or x = foo(bar, baz, bat)
> or x = foo(bar(baz), bat)
> or x = foo(bar, baz(bat))
> or x = foo(bar(baz, bat))

It will be x=foo(bar,baz,bat). The parenthese ommition would only be
valable for the first function call in the statement.

> or ... [even ignoring the possibility that one or more of these might be
> functions callable without arguments...!!!]...

That won''t be a problem: "x=foo bar(baz) bat" would be equivalent to
"x=foo(bar(baz),bat)".
Or, but least realistic, it would be in the scheme trend. For example:

a=b(c,d(e,f(g,h,i,j,k))) <==> a=b c (d e (f g h i j k))

It looks nicer, isn't it? :)

> iPython has some heuristics that may be reasonable for the commandline
> (and are, in any case, at least simple), but in practice I find that I
> go back to using the good old interactive Python interpreter rather than
> putting up with even those simple heuristics.

That depends of your need to such tools. For example if you need to
copy a file, then, resolve a linear system then chroot and set the
password as de hexadecimal representation of the hash function of pi
multiplied by the averge of the solution coordinations +_+, you'll need
IPython ;)




More information about the Python-list mailing list