Thought on PEP 204 and 276

Gonçalo Rodrigues op73418 at mail.telepac.pt
Mon May 27 16:04:41 EDT 2002


On Mon, 27 May 2002 18:31:11 +0100, Steve Horne
<steve at lurking.demon.co.uk> wrote:

>
>I can't help being disappointed that PEP 204 was rejected. To me,
>
>  for i in [0:10] :
>
>is much more intuitive than the PEP 276 version
>
>  for i in 10 :
>
>
>As for the ideas like allowing '[1, 5:10, 20]', combining the syntax
>with list comprehensions, etc I feel the common policy of KISS (ie
>just do the minimal slice-like notation) is a good principle.
>
>On the issue that it could be confused with slices, consider the
>following...
>
>  (1, 2)
>
>Is that a tuple containing the values 1 and 2, or is it the actual
>parameter list for a function call? - you can only tell from the
>context (ie was there a function name, variable containing a lambda or
>whatever to the left). Clearly the slice/range-list dilemma is no more
>confusing than syntax that already exists.
>
>As for being non-obvious, I'd say it's as obvious as using the slice
>notation for slices.
>
>In short, PEP 204 seems intuitive to me while PEP 276 makes me worry.
>
>Am I alone in thinking this?

AFAIK PEP 276 has been withdrawn so no need to worry about that.

Best,
Gonçalo Rodrigues




More information about the Python-list mailing list