print() in Python 3000 return value?

"Martin v. Löwis" martin at v.loewis.de
Mon Apr 3 01:39:57 EDT 2006


bayerj wrote:
>> Sorry? 2+2 here returns 4, and certainly should with your Python.
> 
> Err. Never mind. I was thinking about assignments, like
> 
>>>> x += 2
> 
> which returns None.

Actually, assignment, in Python, is a statement, not an expression.
Statements don't return anything, not even None (they don't have
a value). If print becomes a function, the question about its return
value becomes meaningful.

Regards,
Martin



More information about the Python-list mailing list