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
80ec8364
Kaydet (Commit)
80ec8364
authored
Mar 19, 2017
tarafından
Serhiy Storchaka
Kaydeden (comit)
GitHub
Mar 19, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-29748: Added the slice index converter in Argument Clinic. (#549)
üst
a5af6e1a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
3 deletions
+25
-3
ceval.h
Include/ceval.h
+1
-0
NEWS
Misc/NEWS
+2
-0
listobject.c
Objects/listobject.c
+3
-3
ceval.c
Python/ceval.c
+7
-0
clinic.py
Tools/clinic/clinic.py
+12
-0
No files found.
Include/ceval.h
Dosyayı görüntüle @
80ec8364
...
@@ -223,6 +223,7 @@ PyAPI_FUNC(Py_ssize_t) _PyEval_RequestCodeExtraIndex(freefunc);
...
@@ -223,6 +223,7 @@ PyAPI_FUNC(Py_ssize_t) _PyEval_RequestCodeExtraIndex(freefunc);
#ifndef Py_LIMITED_API
#ifndef Py_LIMITED_API
PyAPI_FUNC
(
int
)
_PyEval_SliceIndex
(
PyObject
*
,
Py_ssize_t
*
);
PyAPI_FUNC
(
int
)
_PyEval_SliceIndex
(
PyObject
*
,
Py_ssize_t
*
);
PyAPI_FUNC
(
int
)
_PyEval_SliceIndexOrNone
(
PyObject
*
,
Py_ssize_t
*
);
PyAPI_FUNC
(
void
)
_PyEval_SignalAsyncExc
(
void
);
PyAPI_FUNC
(
void
)
_PyEval_SignalAsyncExc
(
void
);
#endif
#endif
...
...
Misc/NEWS
Dosyayı görüntüle @
80ec8364
...
@@ -937,6 +937,8 @@ Build
...
@@ -937,6 +937,8 @@ Build
Tools
/
Demos
Tools
/
Demos
-----------
-----------
-
bpo
-
29748
:
Added
the
slice
index
converter
in
Argument
Clinic
.
-
bpo
-
24037
:
Argument
Clinic
now
uses
the
converter
`
bool
(
accept
={
int
})`
rather
-
bpo
-
24037
:
Argument
Clinic
now
uses
the
converter
`
bool
(
accept
={
int
})`
rather
than
`
int
`
for
semantical
booleans
.
This
avoids
repeating
the
default
than
`
int
`
for
semantical
booleans
.
This
avoids
repeating
the
default
value
for
Python
and
C
and
will
help
in
converting
to
`
bool
`
in
future
.
value
for
Python
and
C
and
will
help
in
converting
to
`
bool
`
in
future
.
...
...
Objects/listobject.c
Dosyayı görüntüle @
80ec8364
...
@@ -2210,8 +2210,8 @@ PyList_AsTuple(PyObject *v)
...
@@ -2210,8 +2210,8 @@ PyList_AsTuple(PyObject *v)
list.index
list.index
value: object
value: object
start:
object(converter="_PyEval_SliceIndex", type="Py_ssize_t"
) = 0
start:
slice_index(accept={int}
) = 0
stop:
object(converter="_PyEval_SliceIndex", type="Py_ssize_t"
, c_default="PY_SSIZE_T_MAX") = sys.maxsize
stop:
slice_index(accept={int}
, c_default="PY_SSIZE_T_MAX") = sys.maxsize
/
/
Return first index of value.
Return first index of value.
...
@@ -2222,7 +2222,7 @@ Raises ValueError if the value is not present.
...
@@ -2222,7 +2222,7 @@ Raises ValueError if the value is not present.
static
PyObject
*
static
PyObject
*
list_index_impl
(
PyListObject
*
self
,
PyObject
*
value
,
Py_ssize_t
start
,
list_index_impl
(
PyListObject
*
self
,
PyObject
*
value
,
Py_ssize_t
start
,
Py_ssize_t
stop
)
Py_ssize_t
stop
)
/*[clinic end generated code: output=ec51b88787e4e481 input=
70b7247e398a6999
]*/
/*[clinic end generated code: output=ec51b88787e4e481 input=
40ec5826303a0eb1
]*/
{
{
Py_ssize_t
i
;
Py_ssize_t
i
;
...
...
Python/ceval.c
Dosyayı görüntüle @
80ec8364
...
@@ -4917,6 +4917,13 @@ _PyEval_SliceIndex(PyObject *v, Py_ssize_t *pi)
...
@@ -4917,6 +4917,13 @@ _PyEval_SliceIndex(PyObject *v, Py_ssize_t *pi)
return
1
;
return
1
;
}
}
int
_PyEval_SliceIndexOrNone
(
PyObject
*
v
,
Py_ssize_t
*
pi
)
{
return
v
==
Py_None
||
_PyEval_SliceIndex
(
v
,
pi
);
}
#define CANNOT_CATCH_MSG "catching classes that do not inherit from "\
#define CANNOT_CATCH_MSG "catching classes that do not inherit from "\
"BaseException is not allowed"
"BaseException is not allowed"
...
...
Tools/clinic/clinic.py
Dosyayı görüntüle @
80ec8364
...
@@ -2659,6 +2659,18 @@ class Py_ssize_t_converter(CConverter):
...
@@ -2659,6 +2659,18 @@ class Py_ssize_t_converter(CConverter):
c_ignored_default
=
"0"
c_ignored_default
=
"0"
class
slice_index_converter
(
CConverter
):
type
=
'Py_ssize_t'
def
converter_init
(
self
,
*
,
accept
=
{
int
,
NoneType
}):
if
accept
==
{
int
}:
self
.
converter
=
'_PyEval_SliceIndex'
elif
accept
==
{
int
,
NoneType
}:
self
.
converter
=
'_PyEval_SliceIndexOrNone'
else
:
fail
(
"slice_index_converter: illegal 'accept' argument "
+
repr
(
accept
))
class
float_converter
(
CConverter
):
class
float_converter
(
CConverter
):
type
=
'float'
type
=
'float'
default_type
=
float
default_type
=
float
...
...
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