Some syntactic sugar proposals

Hrvoje Niksic hniksic at
Mon Nov 15 12:10:29 CET 2010

Dmitry Groshev <lambdadmitry at> 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