preserves/implementations/python/preserves/compat.py

15 lines
214 B
Python
Raw Normal View History

2021-08-16 23:24:50 +00:00
try:
basestring_ = basestring
except NameError:
basestring_ = str
if isinstance(chr(123), bytes):
ord_ = ord
else:
ord_ = lambda x: x
2021-08-17 12:04:38 +00:00
try:
unichr_ = unichr
except NameError:
unichr_ = chr