Changeset 391 for python/trunk/Doc/library/stringio.rst
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Doc/library/stringio.rst
r2 r391 72 72 instead. 73 73 74 Since this module provides a factory function which returns objects of built-in75 types, there's no way to build your own version using subclassing. It's not76 possible to set attributes on it. Use the original :mod:`StringIO` module in77 those cases.78 74 79 Unlike the memory files implemented by the :mod:`StringIO` module, those 80 provided by this module are not able to accept Unicode strings that cannot be 81 encoded as plain ASCII strings. 75 .. function:: StringIO([s]) 82 76 83 Calling :func:`StringIO` with a Unicode string parameter populates 84 the object with the buffer representation of the Unicode string, instead of 85 encoding the string. 77 Return a StringIO-like stream for reading or writing. 86 78 87 Another difference from the :mod:`StringIO` module is that calling 88 :func:`StringIO` with a string parameter creates a read-only object. Unlike an 89 object created without a string parameter, it does not have write methods. 90 These objects are not generally visible. They turn up in tracebacks as 91 :class:`StringI` and :class:`StringO`. 79 Since this is a factory function which returns objects of built-in types, 80 there's no way to build your own version using subclassing. It's not 81 possible to set attributes on it. Use the original :mod:`StringIO` module in 82 those cases. 83 84 Unlike the :mod:`StringIO` module, this module is not able to accept Unicode 85 strings that cannot be encoded as plain ASCII strings. 86 87 Another difference from the :mod:`StringIO` module is that calling 88 :func:`StringIO` with a string parameter creates a read-only object. Unlike an 89 object created without a string parameter, it does not have write methods. 90 These objects are not generally visible. They turn up in tracebacks as 91 :class:`StringI` and :class:`StringO`. 92 93 92 94 93 95 The following data objects are provided as well:
Note:
See TracChangeset
for help on using the changeset viewer.