Skip to content

Commit 29605d6

Browse files
author
Jordan Adler
committed
drop -dev suffix
2 parents 6e4ad71 + e53e849 commit 29605d6

File tree

5 files changed

+31
-31
lines changed

5 files changed

+31
-31
lines changed

docs/faq.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ to Python 2's ``str`` object) and several standard library modules.
220220
``python-future`` supports only Python 2.7+ and Python 3.4+, whereas ``six``
221221
supports all versions of Python from 2.4 onwards. (See
222222
:ref:`supported-versions`.) If you must support older Python versions,
223-
``six`` will be esssential for you. However, beware that maintaining
223+
``six`` will be essential for you. However, beware that maintaining
224224
single-source compatibility with older Python versions is ugly and `not
225225
fun <http://lucumr.pocoo.org/2013/5/21/porting-to-python-3-redux/>`_.
226226

src/future/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@
8686
__license__ = 'MIT'
8787
__copyright__ = 'Copyright 2013-2016 Python Charmers Pty Ltd'
8888
__ver_major__ = 0
89-
__ver_minor__ = 16
89+
__ver_minor__ = 17
9090
__ver_patch__ = 0
91-
__ver_sub__ = ''
91+
__ver_sub__ = '-dev'
9292
__version__ = "%d.%d.%d%s" % (__ver_major__, __ver_minor__,
9393
__ver_patch__, __ver_sub__)

src/future/types/newbytes.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -373,24 +373,24 @@ def __ne__(self, other):
373373
unorderable_err = 'unorderable types: bytes() and {0}'
374374

375375
def __lt__(self, other):
376-
if not isbytes(other):
377-
raise TypeError(self.unorderable_err.format(type(other)))
378-
return super(newbytes, self).__lt__(other)
376+
if isinstance(other, _builtin_bytes):
377+
return super(newbytes, self).__lt__(other)
378+
raise TypeError(self.unorderable_err.format(type(other)))
379379

380380
def __le__(self, other):
381-
if not isbytes(other):
382-
raise TypeError(self.unorderable_err.format(type(other)))
383-
return super(newbytes, self).__le__(other)
381+
if isinstance(other, _builtin_bytes):
382+
return super(newbytes, self).__le__(other)
383+
raise TypeError(self.unorderable_err.format(type(other)))
384384

385385
def __gt__(self, other):
386-
if not isbytes(other):
387-
raise TypeError(self.unorderable_err.format(type(other)))
388-
return super(newbytes, self).__gt__(other)
386+
if isinstance(other, _builtin_bytes):
387+
return super(newbytes, self).__gt__(other)
388+
raise TypeError(self.unorderable_err.format(type(other)))
389389

390390
def __ge__(self, other):
391-
if not isbytes(other):
392-
raise TypeError(self.unorderable_err.format(type(other)))
393-
return super(newbytes, self).__ge__(other)
391+
if isinstance(other, _builtin_bytes):
392+
return super(newbytes, self).__ge__(other)
393+
raise TypeError(self.unorderable_err.format(type(other)))
394394

395395
def __native__(self):
396396
# We can't just feed a newbytes object into str(), because

src/future/types/newstr.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -302,24 +302,28 @@ def __ne__(self, other):
302302
unorderable_err = 'unorderable types: str() and {0}'
303303

304304
def __lt__(self, other):
305-
if not istext(other):
306-
raise TypeError(self.unorderable_err.format(type(other)))
307-
return super(newstr, self).__lt__(other)
305+
if (isinstance(other, unicode) or
306+
isinstance(other, bytes) and not isnewbytes(other)):
307+
return super(newstr, self).__lt__(other)
308+
raise TypeError(self.unorderable_err.format(type(other)))
308309

309310
def __le__(self, other):
310-
if not istext(other):
311-
raise TypeError(self.unorderable_err.format(type(other)))
312-
return super(newstr, self).__le__(other)
311+
if (isinstance(other, unicode) or
312+
isinstance(other, bytes) and not isnewbytes(other)):
313+
return super(newstr, self).__le__(other)
314+
raise TypeError(self.unorderable_err.format(type(other)))
313315

314316
def __gt__(self, other):
315-
if not istext(other):
316-
raise TypeError(self.unorderable_err.format(type(other)))
317-
return super(newstr, self).__gt__(other)
317+
if (isinstance(other, unicode) or
318+
isinstance(other, bytes) and not isnewbytes(other)):
319+
return super(newstr, self).__gt__(other)
320+
raise TypeError(self.unorderable_err.format(type(other)))
318321

319322
def __ge__(self, other):
320-
if not istext(other):
321-
raise TypeError(self.unorderable_err.format(type(other)))
322-
return super(newstr, self).__ge__(other)
323+
if (isinstance(other, unicode) or
324+
isinstance(other, bytes) and not isnewbytes(other)):
325+
return super(newstr, self).__ge__(other)
326+
raise TypeError(self.unorderable_err.format(type(other)))
323327

324328
def __getattribute__(self, name):
325329
"""

tests/test_future/test_str.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -382,10 +382,6 @@ def test_cmp(self):
382382
s > 3
383383
with self.assertRaises(TypeError):
384384
s < 1000
385-
with self.assertRaises(TypeError):
386-
s > b'XYZ'
387-
with self.assertRaises(TypeError):
388-
s < b'XYZ'
389385
with self.assertRaises(TypeError):
390386
s <= 3
391387
with self.assertRaises(TypeError):

0 commit comments

Comments
 (0)