This module provides several subtle things to support multiple Python versions (2.6, 2.7, 3.2, 3.3) and VM implementations (CPython, PyPy).
(bool) Whether it is IronPython or not.
(bool) Whether it is Python 3.x or not.
(bool) Whether the Python VM uses Unicode strings by default. It must be True if PY3 or IronPython.
Makes string to str in Python 2. Makes string to bytes in Python 3 or IronPython.
Parameters: |
|
---|
(type) Type for representing binary data. str in Python 2 and bytes in Python 3.
alias of str
If filename is a text_type, encode it to binary_type according to filesystem’s default encoding.
(type, tuple) Types for file objects that have fileno().
(type) Type for text data. basestring in Python 2 and str in Python 3.
alias of basestring
Makes string to str in Python 3 or IronPython. Does nothing in Python 2.
Parameters: | string (bytes, str, unicode) – a string to cast it to text_type |
---|