[pypy-commit] pypy py3k: Replaced long and xrange keywards in the operator module.

prestontimmons noreply at buildbot.pypy.org
Mon Mar 12 22:00:40 CET 2012


Author: Preston Timmons <prestontimmons at gmail.com>
Branch: py3k
Changeset: r53347:57b982e2727f
Date: 2012-03-12 20:45 +0000
http://bitbucket.org/pypy/pypy/changeset/57b982e2727f/

Log:	Replaced long and xrange keywards in the operator module.

diff --git a/pypy/module/operator/app_operator.py b/pypy/module/operator/app_operator.py
--- a/pypy/module/operator/app_operator.py
+++ b/pypy/module/operator/app_operator.py
@@ -39,7 +39,7 @@
 
 def repeat(obj, num):
     'repeat(a, b) -- Return a * b, where a is a sequence, and b is an integer.'
-    if not isinstance(num, (int, long)):
+    if not isinstance(num, int):
         raise TypeError('an integer is required')
     if not isSequenceType(obj):
         raise TypeError("non-sequence object can't be repeated")
diff --git a/pypy/module/operator/test/test_operator.py b/pypy/module/operator/test/test_operator.py
--- a/pypy/module/operator/test/test_operator.py
+++ b/pypy/module/operator/test/test_operator.py
@@ -145,7 +145,7 @@
         raises(TypeError, operator.isSequenceType)
         assert operator.isSequenceType(dir())
         assert operator.isSequenceType(())
-        assert operator.isSequenceType(xrange(10))
+        assert operator.isSequenceType(range(10))
         assert operator.isSequenceType('yeahbuddy')
         assert not operator.isSequenceType(3)
         class Dict(dict): pass


More information about the pypy-commit mailing list