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
1dc5a84a
Kaydet (Commit)
1dc5a84a
authored
Şub 19, 2006
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Bug #801349: document that start/stop/step slice arguments can be None
üst
b2699b24
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
libstdtypes.tex
Doc/lib/libstdtypes.tex
+6
-5
ceval.c
Python/ceval.c
+1
-1
No files found.
Doc/lib/libstdtypes.tex
Dosyayı görüntüle @
1dc5a84a
...
...
@@ -532,9 +532,10 @@ In Python 2.3 and beyond, \var{x} may be a string of any length.
\item
[(4)]
The slice of
\var
{
s
}
from
\var
{
i
}
to
\var
{
j
}
is defined as
the sequence of items with index
\var
{
k
}
such that
\code
{
\var
{
i
}
<=
\var
{
k
}
<
\var
{
j
}}
. If
\var
{
i
}
or
\var
{
j
}
is greater than
\code
{
len(
\var
{
s
}
)
}
, use
\code
{
len(
\var
{
s
}
)
}
. If
\var
{
i
}
is omitted,
use
\code
{
0
}
. If
\var
{
j
}
is omitted, use
\code
{
len(
\var
{
s
}
)
}
. If
\var
{
i
}
is greater than or equal to
\var
{
j
}
, the slice is empty.
\code
{
len(
\var
{
s
}
)
}
, use
\code
{
len(
\var
{
s
}
)
}
. If
\var
{
i
}
is omitted
or
\code
{
None
}
, use
\code
{
0
}
. If
\var
{
j
}
is omitted or
\code
{
None
}
,
use
\code
{
len(
\var
{
s
}
)
}
. If
\var
{
i
}
is greater than or equal to
\var
{
j
}
,
the slice is empty.
\item
[(5)]
The slice of
\var
{
s
}
from
\var
{
i
}
to
\var
{
j
}
with step
\var
{
k
}
is defined as the sequence of items with index
...
...
@@ -543,9 +544,9 @@ In Python 2.3 and beyond, \var{x} may be a string of any length.
are
\code
{
i
}
,
\code
{
i+k
}
,
\code
{
i+2*k
}
,
\code
{
i+3*k
}
and so on, stopping when
\var
{
j
}
is reached (but never including
\var
{
j
}
). If
\var
{
i
}
or
\var
{
j
}
is greater than
\code
{
len(
\var
{
s
}
)
}
, use
\code
{
len(
\var
{
s
}
)
}
. If
\var
{
i
}
or
\var
{
j
}
are omitted
then
they become ``end'' values
\var
{
i
}
or
\var
{
j
}
are omitted
or
\code
{
None
}
,
they become ``end'' values
(which end depends on the sign of
\var
{
k
}
). Note,
\var
{
k
}
cannot
be zero.
be zero.
If
\var
{
k
}
is
\code
{
None
}
, it is treated like
\code
{
1
}
.
\item
[(6)]
If
\var
{
s
}
and
\var
{
t
}
are both strings, some Python
implementations such as CPython can usually perform an in-place optimization
...
...
Python/ceval.c
Dosyayı görüntüle @
1dc5a84a
...
...
@@ -3905,7 +3905,7 @@ _PyEval_SliceIndex(PyObject *v, Py_ssize_t *pi)
}
}
else
{
PyErr_SetString
(
PyExc_TypeError
,
"slice indices must be integers"
);
"slice indices must be integers
or None
"
);
return
0
;
}
*
pi
=
x
;
...
...
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