Am 11.08.2021 um 05:22 schrieb Terry Reedy:
Python is a little looser about whitespace than one might expect from reading 'normal' code when the result is unambiguous in that it cannot really mean anything other than what it does.  Two other examples:

>>> if3: print('yes!')
yes!
>>> [0]  [0]
0

Not sure what you mean here - is it a joke? The first looks like an if statement, but isn't. The missing space *does* make a difference. (Try "if0" instead.)

The second is normal indexing, which allows white space. I wouldn't consider that surprising, but maybe I should? (Honest question, I really don't know.)

--
Wolfram Hinderer
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to