UNIX-style sort in Python?

Andrew Dalke adalke at mindspring.com
Mon Oct 18 20:10:05 CEST 2004


Michael Hoffman wrote:
> Me too. Could the grammar conceivably be changed so that it works 
> without the parantheses there?

Unlikely.  As I recall Python deliberately uses only a
lookahead-1 to resolve ambiguities.


Or see PEP 202

] BDFL Pronouncements
]
]    - The form [x, y for ...] is disallowed; one is required to write
]      [(x, y) for ...].


It could be made an arbitrary lookahead in theory, but
as I recall Guido has also said doesn't want that because
it makes human parsing more complex as well.

Can't find a ready citation for that though.

				Andrew
				dalke at dalkescientific.com



More information about the Python-list mailing list