This commit is contained in:
2025-11-24 08:27:50 +08:00
parent 6940f17517
commit e76152945e
104 changed files with 10003 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
import sys
PY2 = sys.version_info[0] == 2
PY3 = not PY2
def is_string(obj):
if PY2:
# noinspection PyUnresolvedReferences
return isinstance(obj, basestring)
return isinstance(obj, str)
# need to use a new-style class in case of python2, or "normal" class otherwise
if PY2:
class Object(object):
pass
else:
class Object:
pass