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
e812d29b
Kaydet (Commit)
e812d29b
authored
Ara 19, 2009
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #7545: improve documentation of the `buffering` argument in io.open().
üst
d86e9d76
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
8 deletions
+43
-8
io.rst
Doc/library/io.rst
+14
-4
_pyio.py
Lib/_pyio.py
+15
-0
_iomodule.c
Modules/_io/_iomodule.c
+14
-4
No files found.
Doc/library/io.rst
Dosyayı görüntüle @
e812d29b
...
...
@@ -106,10 +106,20 @@ Module Interface
:class:`unicode` strings, the bytes having been first decoded using a
platform-dependent encoding or using the specified *encoding* if given.
*buffering* is an optional integer used to set the buffering policy. By
default full buffering is on. Pass 0 to switch buffering off (only allowed
in binary mode), 1 to set line buffering, and an integer > 1 to indicate the
size of the buffer.
*buffering* is an optional integer used to set the buffering policy.
Pass 0 to switch buffering off (only allowed in binary mode), 1 to select
line buffering (only usable in text mode), and an integer > 1 to indicate
the size of a fixed-size chunk buffer. When no *buffering* argument is
given, the default buffering policy works as follows:
* Binary files are buffered in fixed-size chunks; the size of the buffer
is chosen using a heuristic trying to determine the underlying device's
"block size" and falling back on :attr:`DEFAULT_BUFFER_SIZE`.
On many systems, the buffer will typically be 4096 or 8192 bytes long.
* "Interactive" text files (files for which :meth:`isatty` returns True)
use line buffering. Other text files use the policy described above
for binary files.
*encoding* is the name of the encoding used to decode or encode the file.
This should only be used in text mode. The default encoding is platform
...
...
Lib/_pyio.py
Dosyayı görüntüle @
e812d29b
...
...
@@ -92,6 +92,21 @@ def open(file, mode="r", buffering=None,
allowed in binary mode), 1 to set line buffering, and an integer > 1
for full buffering.
buffering is an optional integer used to set the buffering policy.
Pass 0 to switch buffering off (only allowed in binary mode), 1 to select
line buffering (only usable in text mode), and an integer > 1 to indicate
the size of a fixed-size chunk buffer. When no buffering argument is
given, the default buffering policy works as follows:
* Binary files are buffered in fixed-size chunks; the size of the buffer
is chosen using a heuristic trying to determine the underlying device's
"block size" and falling back on `io.DEFAULT_BUFFER_SIZE`.
On many systems, the buffer will typically be 4096 or 8192 bytes long.
* "Interactive" text files (files for which isatty() returns True)
use line buffering. Other text files use the policy described above
for binary files.
encoding is the name of the encoding used to decode or encode the
file. This should only be used in text mode. The default encoding is
platform dependent, but any encoding supported by Python can be
...
...
Modules/_io/_iomodule.c
Dosyayı görüntüle @
e812d29b
...
...
@@ -219,10 +219,20 @@ PyDoc_STRVAR(open_doc,
"returned as strings, the bytes having been first decoded using a
\n
"
"platform-dependent encoding or using the specified encoding if given.
\n
"
"
\n
"
"buffering is an optional integer used to set the buffering policy. By
\n
"
"default full buffering is on. Pass 0 to switch buffering off (only
\n
"
"allowed in binary mode), 1 to set line buffering, and an integer > 1
\n
"
"for full buffering.
\n
"
"buffering is an optional integer used to set the buffering policy.
\n
"
"Pass 0 to switch buffering off (only allowed in binary mode), 1 to select
\n
"
"line buffering (only usable in text mode), and an integer > 1 to indicate
\n
"
"the size of a fixed-size chunk buffer. When no buffering argument is
\n
"
"given, the default buffering policy works as follows:
\n
"
"
\n
"
"* Binary files are buffered in fixed-size chunks; the size of the buffer
\n
"
" is chosen using a heuristic trying to determine the underlying device's
\n
"
"
\"
block size
\"
and falling back on `io.DEFAULT_BUFFER_SIZE`.
\n
"
" On many systems, the buffer will typically be 4096 or 8192 bytes long.
\n
"
"
\n
"
"*
\"
Interactive
\"
text files (files for which isatty() returns True)
\n
"
" use line buffering. Other text files use the policy described above
\n
"
" for binary files.
\n
"
"
\n
"
"encoding is the name of the encoding used to decode or encode the
\n
"
"file. This should only be used in text mode. The default encoding is
\n
"
...
...
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