On 2021-08-11 18:10, Wolfram Hinderer via Python-list wrote:


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.)

I see what you mean. It's a type annotation:

    var: type

where the "type" is a print statement!

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.)

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

Reply via email to