[issue1766304] improve xrange.__contains__

Mark Dickinson report at bugs.python.org
Thu Sep 3 12:06:56 CEST 2009


Mark Dickinson <dickinsm at gmail.com> added the comment:

[Joseph Thomson]
> Also, as I said in my closed duplicate issue, 'if value in range(lower,
> upper)' to me looks far more Pythonic than 'if value >= lower and value
> < upper'.

Note that the Pythonic spelling would be:  'if lower <= value < upper'.
 (Though that's not quite the same thing if value is not an integer.)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1766304>
_______________________________________


More information about the Python-bugs-list mailing list