a = b = 1 just syntactic sugar?

Terry Reedy tjreedy at udel.edu
Mon Jun 9 09:02:36 EDT 2003


"Moshe Zadka" <m at moshez.org> wrote in message
news:mailman.1055158397.32494.python-list at python.org...
> Well, I don't know about yield or exec, but I actually *would* like
to
> print from lambdas, I do it a lot when debugging Twisted code:

Which you can do with more control (and more effort) with file.write.
The funny thing is that Guido intended print as a quick and easy
substitute with reasonable defaults mainly for interactive use, with
the expectation that production code would use the more exact full
form.  But the defaults are so useful that demand arose to 'print' to
any file, not just stdout, hence '>>file'.  And now the request to
print rather than write within lambda.

A print function would be more useful here, but having to add ()s
would generally be a nuisance otherwise.  So there was a tradeoff.

Terry J. Reedy






More information about the Python-list mailing list