add compat.strbytes_types which includes all types about string.

This commit is contained in:
Prodesire 2018-01-18 18:27:33 +08:00
parent 54a9753c54
commit 08ea58781c
2 changed files with 6 additions and 0 deletions

View File

@ -45,6 +45,10 @@ Compat
The string types are ``(str, unicode)`` on PY2 or ``(str,)`` on PY3.
.. py:data:: pydu.compat.strbytes_types
The string types are ``(str, unicode, bytes)`` on PY2 or ``(str, bytes)`` on PY3.
.. py:data:: pydu.compat.numeric_types

View File

@ -36,10 +36,12 @@ else:
if PY2:
text_type = unicode
string_types = (str, unicode)
strbytes_types = (str, unicode, bytes)
numeric_types = (int, long)
else:
text_type = str
string_types = (str,)
strbytes_types = (str, bytes)
numeric_types = (int,)
# imap