On Jul 4, 9:31 am, jmfauth <wxjmfa...@gmail.com> wrote: > Python all versions. > > It's not a bug, but I'm suprised the following does > not raise a SyntaxError (missing space between > '9' and 'for'). > > > > >>> [9for c in 'abc'] > [9, 9, 9] > > Side effect: If this behaviour is considered as correct, > it makes a correct Python code styling (IDLE, editors, ...) > practically impossible to realise.
Why? If Python itself has no problem parsing this code, why should it be so difficult for editors? Python's grammar is fairly simple: it's LL(1) (unlike C's, for example), so can be parsed with only 1 token of lookahead. -- Mark -- http://mail.python.org/mailman/listinfo/python-list