mirror of https://github.com/mahmoud/boltons.git
Python 3 support: .compat.xrange
This commit is contained in:
parent
0082e13048
commit
5befcaecf3
|
@ -9,9 +9,11 @@ IS_PY3 = sys.version_info[0] == 3
|
|||
if IS_PY2:
|
||||
from StringIO import StringIO
|
||||
unicode, str, bytes, basestring = unicode, str, str, basestring
|
||||
xrange = xrange
|
||||
elif IS_PY3:
|
||||
from io import StringIO
|
||||
unicode, str, bytes, basestring = str, bytes, bytes, str
|
||||
xrange = range
|
||||
else:
|
||||
raise NotImplementedError('welcome to the future, I guess. (report this)')
|
||||
|
||||
|
|
|
@ -34,6 +34,9 @@ from __future__ import print_function
|
|||
import gc
|
||||
import sys
|
||||
|
||||
from .compat import xrange
|
||||
|
||||
|
||||
__all__ = ['get_all', 'GCToggler', 'toggle_gc', 'toggle_gc_postcollect']
|
||||
|
||||
|
||||
|
|
|
@ -15,11 +15,9 @@ import operator
|
|||
from math import log as math_log
|
||||
from itertools import chain, islice
|
||||
|
||||
try:
|
||||
from compat import make_sentinel
|
||||
_MISSING = make_sentinel(var_name='_MISSING')
|
||||
except ImportError:
|
||||
_MISSING = object()
|
||||
from .compat import make_sentinel, xrange
|
||||
_MISSING = make_sentinel(var_name='_MISSING')
|
||||
|
||||
|
||||
# TODO: expose splaylist?
|
||||
__all__ = ['BList', 'BarrelList']
|
||||
|
|
Loading…
Reference in New Issue