Some syntactic sugar proposals

Hrvoje Niksic hniksic at xemacs.org
Mon Nov 15 06:10:29 EST 2010


Dmitry Groshev <lambdadmitry at gmail.com> writes:

> which looks almost like a natural language. But there is some
> pitfalls:
>     if x in range(a, b): #wrong!
> it feels so natural to check it that way, but we have to write
>     if a <= x <= b

For the record, you have to write:

    if a <= x < b:

Ranges are open on the ending side.



More information about the Python-list mailing list