Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
994815e1
Kaydet (Commit)
994815e1
authored
Eki 10, 2015
tarafından
Martin Panter
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #22413: Merge StringIO doc from 3.4 into 3.5
üst
3cae7577
cfad5434
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
io.rst
Doc/library/io.rst
+12
-4
_iomodule.h
Modules/_io/_iomodule.h
+6
-1
No files found.
Doc/library/io.rst
Dosyayı görüntüle @
994815e1
...
...
@@ -889,10 +889,16 @@ Text I/O
An in-memory stream for text I/O. The text buffer is discarded when the
:meth:`~IOBase.close` method is called.
The initial value of the buffer (an empty string by default) can be set by
providing *initial_value*. The *newline* argument works like that of
:class:`TextIOWrapper`. The default is to consider only ``\n`` characters
as end of lines and to do no newline translation.
The initial value of the buffer can be set by providing *initial_value*.
If newline translation is enabled, newlines will be encoded as if by
:meth:`~TextIOBase.write`. The stream is positioned at the start of
the buffer.
The *newline* argument works like that of :class:`TextIOWrapper`.
The default is to consider only ``\n`` characters as ends of lines and
to do no newline translation. If *newline* is set to ``None``,
newlines are written as ``\n`` on all platforms, but universal
newline decoding is still performed when reading.
:class:`StringIO` provides this method in addition to those from
:class:`TextIOBase` and its parents:
...
...
@@ -900,6 +906,8 @@ Text I/O
.. method:: getvalue()
Return a ``str`` containing the entire contents of the buffer.
Newlines are decoded as if by :meth:`~TextIOBase.read`, although
the stream position is not changed.
Example usage::
...
...
Modules/_io/_iomodule.h
Dosyayı görüntüle @
994815e1
...
...
@@ -52,7 +52,12 @@ extern PyObject *_PyIncrementalNewlineDecoder_decode(
which can be safely put aside until another search.
NOTE: for performance reasons, `end` must point to a NUL character ('\0').
Otherwise, the function will scan further and return garbage. */
Otherwise, the function will scan further and return garbage.
There are three modes, in order of priority:
* translated: Only find \n (assume newlines already translated)
* universal: Use universal newlines algorithm
* Otherwise, the line ending is specified by readnl, a str object */
extern
Py_ssize_t
_PyIO_find_line_ending
(
int
translated
,
int
universal
,
PyObject
*
readnl
,
int
kind
,
char
*
start
,
char
*
end
,
Py_ssize_t
*
consumed
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment