[Python-3000-checkins] r61659 - python/branches/py3k/Lib/test/test_winsound.py

Brett Cannon brett at python.org
Fri Mar 21 04:12:48 CET 2008


On Thu, Mar 20, 2008 at 8:04 PM,  <skip at pobox.com> wrote:
> >>>>> "Brett" == Brett Cannon <brett at python.org> writes:
>
>     Brett> On Wed, Mar 19, 2008 at 8:02 PM, amaury.forgeotdarc
>
>     >> Log:
>     >> Another 2.6-ism in test file
>     ...
>
>     >> -        for i in xrange(100, 2000, 100):
>     >> +        for i in range(100, 2000, 100):
>
>     Brett> How is this a 2.6ism?
>
>  3.0 spells it "range".  "xrange" is gone:
>
>     $ ./python.exe
>     Python 3.0a3+ (py3k:61686, Mar 20 2008, 22:00:17)
>     [GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin
>     Type "help", "copyright", "credits" or "license" for more information.
>     >>> xrange
>     Traceback (most recent call last):
>       File "<stdin>", line 1, in <module>
>     NameError: name 'xrange' is not defined
>     >>> range
>     <type 'range'>

Right, but 2to3 will handle the conversion. This will just cause 2to3
to turn ``range(100)`` into ``list(range(100))``.

-Brett


More information about the Python-3000-checkins mailing list