evaluation question

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Jan 31 18:18:58 EST 2023


On 1/02/23 7:33 am, Stefan Ram wrote:
> Thomas Passin <list1 at tompassin.net> writes:

>    Some people say it is a function now so that you can redefine it.

Well, that's one benefit, but I wouldn't say it's the main one.

The point is really that you can do *anything* with it now that
you can do with a regular function -- pass it as an argument,
wrap it with another function, define your own function with a
similar signature for duck-typing purposes, etc.

>    It would still be possible to have a special syntax for the outermost
>    expression of an expression statement that would allow one to omit
>    the parentheses,

That's only one of the syntactic oddities of the old print
statement, thogh. There was also the >> thing, special treatment
of trailing commas, etc.

Also, introducing a paren-less call syntax would be a very big
and controversial change that would be way out of proportion to
the problem.

-- 
Greg


More information about the Python-list mailing list