3 ms·
I initially assumed the missing space was a typo in the headline, so I tried [0x for x in (1,2,3)] and got "invalid hexadecimal literal" as I would have expecte
by commandlinefan 6y ago
I initially assumed the missing space was a typo in the headline, so I tried [0x for x in (1,2,3)] and got "invalid hexadecimal literal" as I would have expected. Took me a few minutes to realize the typo was intentional.
I still can't figure out what the author was trying to do when he stumbled onto that, though...
- tsimionescu 6y agoMy guess is that they were trying to do soemthing like [x for x in some_list], but had some unfortunate typos.
- commandlinefan 6y agoYeah maybe he was converting a tuple to a list, but that still seems like a weird way to do it.
- Dylan16807 6y agoThink of it as a simplified version to demonstrate the issue.
- wyldfire 6y agoThis is the kind of thing you could end up with from an automated test case reducer. Start with a typo that causes odd behavior (which might be interpreted as a CPython 'bug') and use something like creduce to whittle it down to the minimal case.