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
93eb42e8
Kaydet (Commit)
93eb42e8
authored
Tem 10, 2010
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Emphasize role of count for Pascal string.
üst
b382337e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
struct.rst
Doc/library/struct.rst
+9
-11
No files found.
Doc/library/struct.rst
Dosyayı görüntüle @
93eb42e8
...
@@ -259,18 +259,16 @@ then :exc:`struct.error` is raised.
...
@@ -259,18 +259,16 @@ then :exc:`struct.error` is raised.
In 3.0, some of the integer formats wrapped out-of-range values and
In 3.0, some of the integer formats wrapped out-of-range values and
raised :exc:`DeprecationWarning` instead of :exc:`struct.error`.
raised :exc:`DeprecationWarning` instead of :exc:`struct.error`.
The ``'p'`` format character encodes a "Pascal string", meaning a short
The ``'p'`` format character encodes a "Pascal string", meaning a short
variable-length string stored in a fixed number of bytes. The count is the total
variable-length string stored in a *fixed number of bytes*, given by the count.
number of bytes stored. The first byte stored is the length of the string, or
The first byte stored is the length of the string, or 255, whichever is
255, whichever is smaller. The bytes of the string follow. If the string
smaller. The bytes of the string follow. If the string passed in to
passed in to :func:`pack` is too long (longer than the count minus 1), only the
:func:`pack` is too long (longer than the count minus 1), only the leading
leading count-1 bytes of the string are stored. If the string is shorter than
``count-1`` bytes of the string are stored. If the string is shorter than
count-1, it is padded with null bytes so that exactly count bytes in all are
``count-1``, it is padded with null bytes so that exactly count bytes in all
used. Note that for :func:`unpack`, the ``'p'`` format character consumes count
are used. Note that for :func:`unpack`, the ``'p'`` format character consumes
bytes, but that the string returned can never contain more than 255 bytes.
``count`` bytes, but that the string returned can never contain more than 255
bytes.
For the ``'?'`` format character, the return value is either :const:`True` or
For the ``'?'`` format character, the return value is either :const:`True` or
:const:`False`. When packing, the truth value of the argument object is used.
:const:`False`. When packing, the truth value of the argument object is used.
...
...
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