D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
usr
/
lib
/
python3.6
/
site-packages
/
past
/
types
/
Filename :
basestring.py
back
Copy
""" An implementation of the basestring type for Python 3 Example use: >>> s = b'abc' >>> assert isinstance(s, basestring) >>> from past.types import str as oldstr >>> s2 = oldstr(b'abc') >>> assert isinstance(s2, basestring) """ import sys from past.utils import with_metaclass, PY2 if PY2: str = unicode ver = sys.version_info[:2] class BaseBaseString(type): def __instancecheck__(cls, instance): return isinstance(instance, (bytes, str)) def __subclasscheck__(cls, subclass): return super(BaseBaseString, cls).__subclasscheck__(subclass) or issubclass(subclass, (bytes, str)) class basestring(with_metaclass(BaseBaseString)): """ A minimal backport of the Python 2 basestring type to Py3 """ __all__ = ['basestring']
Name
Size
Last Modified
Owner
Permissions
Actions
__pycache__
Dir
July 28 2023 3:19:19
root
0755
__init__.py
0.858
KB
January 13 2023 3:16:35
root
0644
basestring.py
0.756
KB
January 13 2023 3:16:35
root
0644
olddict.py
2.657
KB
January 13 2023 3:16:35
root
0644
oldstr.py
4.231
KB
January 13 2023 3:16:35
root
0644
2017 © D7net | D704T team