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
5ec22f2d
Kaydet (Commit)
5ec22f2d
authored
Eyl 24, 2002
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Another try at clarifying what goes into and comes out of Unicode objects.
Document the indices() method of slice objects.
üst
3e930ba5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
12 deletions
+20
-12
ref3.tex
Doc/ref/ref3.tex
+20
-12
No files found.
Doc/ref/ref3.tex
Dosyayı görüntüle @
5ec22f2d
...
...
@@ -305,15 +305,19 @@ Or perhaps someone can propose a better rule?)
\bifuncindex
{
ord
}
\item
[Unicode]
The items of a Unicode object are Unicode characters. A Unicode
character is represented by a Unicode object of one item and can hold
a 16-bit value representing a Unicode ordinal. The built-in functions
The items of a Unicode object are Unicode code units. A Unicode code
unit is represented by a Unicode object of one item and can hold
either a 16-bit or 32-bit value representing a Unicode ordinal (the
maximum value for the ordinal is given in
\code
{
sys.maxunicode
}
, and
depends on how Python is configured at compile time). Surrogate pairs
may be present in the Unicode object, and will be reported as two
separate items. The built-in functions
\function
{
unichr()
}
\bifuncindex
{
unichr
}
and
\function
{
ord()
}
\bifuncindex
{
ord
}
convert between c
haracter
s and
\function
{
ord()
}
\bifuncindex
{
ord
}
convert between c
ode unit
s and
nonnegative integers representing the Unicode ordinals as defined in
the Unicode Standard 3.0. Conversion from and to other encodings are
possible through the Unicode method
\method
{
encode
}
and the built-in
function
\function
{
unicode()
}
\bifuncindex
{
unicode
}
.
function
\function
{
unicode()
}
.
\bifuncindex
{
unicode
}
\obindex
{
unicode
}
\index
{
character
}
\index
{
integer
}
...
...
@@ -892,14 +896,18 @@ Special read-only attributes: \member{start} is the lower bound;
\ttindex
{
stop
}
\ttindex
{
step
}}
Special method:
\method
{
indices
}
takes an single integer argument
\var
{
length
}
and computes information about the extended slice that
the slice object would describe if applied to a sequence of
\var
{
length
}
. It returns a tuple of three integers; respectively
these are the
\var
{
start
}
and
\var
{
stop
}
indices and the
\var
{
step
}
or
stride length of the slice. Missing or out-of-bounds indices are
handled in a manner consistent with regular slices.
Slice objects support one method:
\begin{methoddesc}
[slice]
{
indices
}{
self, length
}
This method takes a single integer argument
\var
{
length
}
and computes
information about the extended slice that the slice object would
describe if applied to a sequence of
\var
{
length
}
items. It returns a
tuple of three integers; respectively these are the
\var
{
start
}
and
\var
{
stop
}
indices and the
\var
{
step
}
or stride length of the slice.
Missing or out-of-bounds indices are handled in a manner consistent
with regular slices.
\versionadded
{
2.3
}
\end{methoddesc}
\end{description}
% Internal 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