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
e8803e75
Kaydet (Commit)
e8803e75
authored
Kas 20, 2010
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #8340: document bytearray in Python 2.7.
üst
bbd72509
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
10 deletions
+41
-10
functions.rst
Doc/library/functions.rst
+26
-0
stdtypes.rst
Doc/library/stdtypes.rst
+15
-10
No files found.
Doc/library/functions.rst
Dosyayı görüntüle @
e8803e75
...
...
@@ -78,6 +78,32 @@ available. They are listed here in alphabetical order.
If no argument is given, this function returns :const:`False`.
.. function:: bytearray([source[, encoding[, errors]]])
Return a new array of bytes. The :class:`bytearray` type is a mutable
sequence of integers in the range 0 <= x < 256. It has most of the usual
methods of mutable sequences, described in :ref:`typesseq-mutable`, as well
as most methods that the :class:`str` type has, see :ref:`string-methods`.
The optional *source* parameter can be used to initialize the array in a few
different ways:
* If it is a *string*, you must also give the *encoding* (and optionally,
*errors*) parameters; :func:`bytearray` then converts the string to
bytes using :meth:`str.encode`.
* If it is an *integer*, the array will have that size and will be
initialized with null bytes.
* If it is an object conforming to the *buffer* interface, a read-only buffer
of the object will be used to initialize the bytes array.
* If it is an *iterable*, it must be an iterable of integers in the range
``0 <= x < 256``, which are used as the initial contents of the array.
Without an argument, an array of size 0 is created.
.. function:: callable(object)
Return :const:`True` if the *object* argument appears callable,
...
...
Doc/library/stdtypes.rst
Dosyayı görüntüle @
e8803e75
...
...
@@ -659,11 +659,11 @@ yield expression <yieldexpr>`.
.. _typesseq:
Sequence Types --- :class:`str`, :class:`unicode`, :class:`list`, :class:`tuple`, :class:`buffer`, :class:`xrange`
==================================================================================================================
Sequence Types --- :class:`str`, :class:`unicode`, :class:`list`, :class:`tuple`, :class:`b
ytearray`, :class:`b
uffer`, :class:`xrange`
==================================================================================================================
====================
There are s
ix sequence types: strings, Unicode strings, lists, tuples, buffer
s,
and xrange objects.
There are s
even sequence types: strings, Unicode strings, lists, tuple
s,
bytearrays, buffers,
and xrange objects.
For other containers see the built in :class:`dict` and :class:`set` classes,
and the :mod:`collections` module.
...
...
@@ -675,6 +675,7 @@ and the :mod:`collections` module.
object: Unicode
object: tuple
object: list
object: bytearray
object: buffer
object: xrange
...
...
@@ -690,6 +691,8 @@ brackets), with or without enclosing parentheses, but an empty tuple
must have the enclosing parentheses, such as ``a, b, c`` or ``()``. A
single item tuple must have a trailing comma, such as ``(d,)``.
Bytearray objects are created with the built-in function :func:`bytearray`.
Buffer objects are not directly supported by Python syntax, but can be created
by calling the built-in function :func:`buffer`. They don't support
concatenation or repetition.
...
...
@@ -834,7 +837,8 @@ String Methods
.. index:: pair: string; methods
Below are listed the string methods which both 8-bit strings and
Unicode objects support.
Unicode objects support. Some of them are also available on :class:`bytearray`
objects.
In addition, Python's strings support the sequence type methods
described in the :ref:`typesseq` section. To output formatted strings
...
...
@@ -1505,11 +1509,12 @@ Mutable Sequence Types
triple: mutable; sequence; types
object: list
List objects support additional operations that allow in-place modification of
the object. Other mutable sequence types (when added to the language) should
also support these operations. Strings and tuples are immutable sequence types:
such objects cannot be modified once created. The following operations are
defined on mutable sequence types (where *x* is an arbitrary object):
List and :class:`bytearray` objects support additional operations that allow
in-place modification of the object. Other mutable sequence types (when added
to the language) should also support these operations. Strings and tuples
are immutable sequence types: such objects cannot be modified once created.
The following operations are defined on mutable sequence types (where *x* is
an arbitrary object):
.. index::
triple: operations on; sequence; types
...
...
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