> On 16 Jun 2020, at 08:51, Greg Ewing <greg.ew...@canterbury.ac.nz> wrote:
> 
> On 16/06/20 12:20 pm, Steven D'Aprano wrote:
>> The whole point of the REPL is to evaluate an
>> expression and have the result printed. (That's the P in REPL :-)
> 
> Still, it's a bit surprising that it prints results of
> expressions within a compound statement, not just at the
> top level.

For what that’s worth, 2.7 seems to have the same behaviour, every statement 
with a non-None result gets echoed even if it is not the top level statement 
e.g. 

Python 2.7.17 (default, April 15 2020, 17:20:14)
[GCC 7.5.0] on linux2
Type “help”, “copyright”, “credits” or “license” for more information. 
>>> for i in range(3): i
...
0
1
2
>>>
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/HSU7EIKRX37SZ4TZPG6N52YKVLETZRN3/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to