3 ms·
There's no ambiguity though, right? [0x for x in (1,2,3)] is nonsense (one typo off from something legitimate, but nonsense regardless). I can't think of anothe
by brundolf 6y ago
There's no ambiguity though, right? [0x for x in (1,2,3)] is nonsense (one typo off from something legitimate, but nonsense regardless). I can't think of another way someone might expect this to parse.
- Skunkleton 6y agoI would have expected the english boolean operators to require whitespace to parse correctly, personally. "0xf||x" makes sense. "0xforx" makes no sense.
- Sohcahtoa82 6y ago"0xforx" would be parsed as "0xf orx" which would be a syntax error.
- Skunkleton 6y agoYeah, I realized after my edit window had expired. Should have been "0xf|| x" and "0xfor x".
- moefh 6y agoIf you want confusion with a valid expression: [0x1for x in (1,2,3)] looks like it should parse as [0x1 for x in (1,2,3)] but instead parses as [0x1f or x in (1,2,3)]
- nickysielicki 6y agoThis is better than the original post.