Comment on PEP-0238
tim.one at home.com
Tue Jul 10 08:09:44 CEST 2001
> print ``1`+`2``
> Holy crap! I can't believe Python parses that correctly
> I think it works because if you see a ` when you're expecting
> the beginning of an expression it must be an opening-`, whereas
> if you see one just after you've seen a complete expression
> it must be a closing-`. Or something like that.
Close enough -- if the grammar production "testlist" could match whitespace,
it would be hosed.
> I was quite surprised when I first saw it, too.
Note that, in the same spirit, we could save a character for other use by
I was quite surprised[1[ when I first saw it, too.
>  Or, in other words, horrified.
luckily-we-never-see-it-in-real-code-ly y'rs - tim
More information about the Python-list