Stefan Ram wrote:
Jon Ribbens <jon+use...@unequivocal.eu> writes:
On 2020-02-02, Stefan Ram <r...@zedat.fu-berlin.de> wrote:
void( ( print( 2 ), print( 3 )))
2
3
I'm not sure why you'd want to - but "None and foo" is an expression
that will return None regardless of the value of "foo".
Yes, but it also does not evaluate the second operand. I.e.,
None and( print( 2 ), print( 3 ))
prints nothing at all.
I was looking for something that still evaluates and then
maps the value obtained to None.
( (print(2), print(3)), None)[1]
I wonder why one would need such a thing, though...
--
https://mail.python.org/mailman/listinfo/python-list