(Oct-19-2016, 04:11 PM)sparkz_alot Wrote: Yes, I understand, I was pointing out the the example "print(())" is actually not a tupleprint function is returning a tuple,but it's in stdout which is not catch in the variable.
Logically, one would think so, but Python does not. As shown in my example, Python see it as class 'NoneType', not class 'tuple'
Variable catch only return type from function.
The print function has no return value def print(*args, sep=' ', end='\n', file=None)
print function is not meant to be stored in a variable,no return in function.
If look at it in an another way,foo is returning an integer but we only catch None('NoneType').
>>> def foo(): ... print(999) ... >>> a = foo() 999 >>> repr(a) 'None' >>> type(a) <class 'NoneType'