diff options
Diffstat (limited to 'documentation')
-rw-r--r-- | documentation/index.rst | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/documentation/index.rst b/documentation/index.rst index 68b2fd7..86c3a03 100644 --- a/documentation/index.rst +++ b/documentation/index.rst @@ -433,6 +433,24 @@ string data in all Python versions. a bytes object iterator in Python 3. +.. function:: ensure_binary(s, encoding='utf-8', errors='strict') + + A helper function to ensure output is :data:`binary_type`. ``encoding``, ``errors`` + are the same as :meth:`py3:str.encode` + + +.. function:: ensure_str(s, encoding='utf-8', errors='strict') + + A helper function to ensure output is ``str``. ``encoding``, ``errors`` + are the same :meth:`py3:str.encode` + + +.. function:: ensure_text(s, encoding='utf-8', errors='strict') + + A helper function to ensure output is :data:`text_type`. ``encoding``, ``errors`` + are the same as :meth:`py3:str.encode` + + .. data:: StringIO This is a fake file object for textual data. It's an alias for |