PEP 260: simplify xrange()

D-Man dsh8290 at rit.edu
Wed Jun 27 13:13:46 EDT 2001


On Tue, Jun 26, 2001 at 07:18:33PM -0400, D-Man wrote:
| 
| def odd_in_range( n , lower , upper ) :
|     return 1 <= n <= 101 and n % 2 == 1

Obviously this is a cut-n-paste typo.

     return lower <= n <= upper and n % 2 == 1

would be better.

-D




More information about the Python-list mailing list