File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -577,15 +577,13 @@ def isbytes(obj):
577577
578578def isnewbytes (obj ):
579579 """
580- Equivalent to the result of ``isinstance(obj, newbytes)`` were
581- ``__instancecheck__`` not overridden on the newbytes subclass. In
582- other words, it is REALLY a newbytes instance, not a Py2 native str
580+ Equivalent to the result of ``type(obj) == type(newbytes)``
581+ in other words, it is REALLY a newbytes instance, not a Py2 native str
583582 object?
583+ Note that this does not cover subclasses of newbytes, and it is not
584+ equivalent to ininstance(obj, newbytes)
584585 """
585- # TODO: generalize this so that it works with subclasses of newbytes
586- # Import is here to avoid circular imports:
587- from future .types .newbytes import newbytes
588- return type (obj ) == newbytes
586+ return type (obj ).__name__ == 'newbytes'
589587
590588
591589def isint (obj ):
You can’t perform that action at this time.
0 commit comments