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
01538269
Kaydet (Commit)
01538269
authored
Mar 17, 2003
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Created PyObject_GenericGetIter().
Factors out the common case of returning self.
üst
08801db1
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
30 additions
and
147 deletions
+30
-147
object.h
Include/object.h
+1
-0
NEWS
Misc/NEWS
+3
-0
itertoolsmodule.c
Modules/itertoolsmodule.c
+12
-96
dictobject.c
Objects/dictobject.c
+1
-8
enumobject.c
Objects/enumobject.c
+1
-8
iterobject.c
Objects/iterobject.c
+2
-9
listobject.c
Objects/listobject.c
+1
-9
object.c
Objects/object.c
+7
-0
rangeobject.c
Objects/rangeobject.c
+1
-8
tupleobject.c
Objects/tupleobject.c
+1
-9
No files found.
Include/object.h
Dosyayı görüntüle @
01538269
...
@@ -385,6 +385,7 @@ PyAPI_FUNC(PyObject *) PyObject_GetAttr(PyObject *, PyObject *);
...
@@ -385,6 +385,7 @@ PyAPI_FUNC(PyObject *) PyObject_GetAttr(PyObject *, PyObject *);
PyAPI_FUNC
(
int
)
PyObject_SetAttr
(
PyObject
*
,
PyObject
*
,
PyObject
*
);
PyAPI_FUNC
(
int
)
PyObject_SetAttr
(
PyObject
*
,
PyObject
*
,
PyObject
*
);
PyAPI_FUNC
(
int
)
PyObject_HasAttr
(
PyObject
*
,
PyObject
*
);
PyAPI_FUNC
(
int
)
PyObject_HasAttr
(
PyObject
*
,
PyObject
*
);
PyAPI_FUNC
(
PyObject
**
)
_PyObject_GetDictPtr
(
PyObject
*
);
PyAPI_FUNC
(
PyObject
**
)
_PyObject_GetDictPtr
(
PyObject
*
);
PyAPI_FUNC
(
PyObject
*
)
PyObject_GenericGetIter
(
PyObject
*
);
PyAPI_FUNC
(
PyObject
*
)
PyObject_GenericGetAttr
(
PyObject
*
,
PyObject
*
);
PyAPI_FUNC
(
PyObject
*
)
PyObject_GenericGetAttr
(
PyObject
*
,
PyObject
*
);
PyAPI_FUNC
(
int
)
PyObject_GenericSetAttr
(
PyObject
*
,
PyAPI_FUNC
(
int
)
PyObject_GenericSetAttr
(
PyObject
*
,
PyObject
*
,
PyObject
*
);
PyObject
*
,
PyObject
*
);
...
...
Misc/NEWS
Dosyayı görüntüle @
01538269
...
@@ -86,6 +86,9 @@ Build
...
@@ -86,6 +86,9 @@ Build
C API
C API
-----
-----
- Added PyObject_GenericGetIter() to fill the tp_iter slot for the
typical case where the method returns its self argument.
- The extended type structure used for heap types (new-style
- The extended type structure used for heap types (new-style
classes defined by Python code using a class statement) is now
classes defined by Python code using a class statement) is now
exported from object.h as PyHeapTypeObject. (SF patch #696193.)
exported from object.h as PyHeapTypeObject. (SF patch #696193.)
...
...
Modules/itertoolsmodule.c
Dosyayı görüntüle @
01538269
...
@@ -105,13 +105,6 @@ cycle_next(cycleobject *lz)
...
@@ -105,13 +105,6 @@ cycle_next(cycleobject *lz)
}
}
}
}
static
PyObject
*
cycle_getiter
(
PyObject
*
lz
)
{
Py_INCREF
(
lz
);
return
lz
;
}
PyDoc_STRVAR
(
cycle_doc
,
PyDoc_STRVAR
(
cycle_doc
,
"cycle(iterable) --> cycle object
\n
\
"cycle(iterable) --> cycle object
\n
\
\n
\
\n
\
...
@@ -147,7 +140,7 @@ PyTypeObject cycle_type = {
...
@@ -147,7 +140,7 @@ PyTypeObject cycle_type = {
0
,
/* tp_clear */
0
,
/* tp_clear */
0
,
/* tp_richcompare */
0
,
/* tp_richcompare */
0
,
/* tp_weaklistoffset */
0
,
/* tp_weaklistoffset */
(
getiterfunc
)
cycle_geti
ter
,
/* tp_iter */
PyObject_GenericGetI
ter
,
/* tp_iter */
(
iternextfunc
)
cycle_next
,
/* tp_iternext */
(
iternextfunc
)
cycle_next
,
/* tp_iternext */
0
,
/* tp_methods */
0
,
/* tp_methods */
0
,
/* tp_members */
0
,
/* tp_members */
...
@@ -261,13 +254,6 @@ dropwhile_next(dropwhileobject *lz)
...
@@ -261,13 +254,6 @@ dropwhile_next(dropwhileobject *lz)
}
}
}
}
static
PyObject
*
dropwhile_getiter
(
PyObject
*
lz
)
{
Py_INCREF
(
lz
);
return
lz
;
}
PyDoc_STRVAR
(
dropwhile_doc
,
PyDoc_STRVAR
(
dropwhile_doc
,
"dropwhile(predicate, iterable) --> dropwhile object
\n
\
"dropwhile(predicate, iterable) --> dropwhile object
\n
\
\n
\
\n
\
...
@@ -303,7 +289,7 @@ PyTypeObject dropwhile_type = {
...
@@ -303,7 +289,7 @@ PyTypeObject dropwhile_type = {
0
,
/* tp_clear */
0
,
/* tp_clear */
0
,
/* tp_richcompare */
0
,
/* tp_richcompare */
0
,
/* tp_weaklistoffset */
0
,
/* tp_weaklistoffset */
(
getiterfunc
)
dropwhile_geti
ter
,
/* tp_iter */
PyObject_GenericGetI
ter
,
/* tp_iter */
(
iternextfunc
)
dropwhile_next
,
/* tp_iternext */
(
iternextfunc
)
dropwhile_next
,
/* tp_iternext */
0
,
/* tp_methods */
0
,
/* tp_methods */
0
,
/* tp_members */
0
,
/* tp_members */
...
@@ -416,13 +402,6 @@ takewhile_next(takewhileobject *lz)
...
@@ -416,13 +402,6 @@ takewhile_next(takewhileobject *lz)
return
NULL
;
return
NULL
;
}
}
static
PyObject
*
takewhile_getiter
(
PyObject
*
lz
)
{
Py_INCREF
(
lz
);
return
lz
;
}
PyDoc_STRVAR
(
takewhile_doc
,
PyDoc_STRVAR
(
takewhile_doc
,
"takewhile(predicate, iterable) --> takewhile object
\n
\
"takewhile(predicate, iterable) --> takewhile object
\n
\
\n
\
\n
\
...
@@ -458,7 +437,7 @@ PyTypeObject takewhile_type = {
...
@@ -458,7 +437,7 @@ PyTypeObject takewhile_type = {
0
,
/* tp_clear */
0
,
/* tp_clear */
0
,
/* tp_richcompare */
0
,
/* tp_richcompare */
0
,
/* tp_weaklistoffset */
0
,
/* tp_weaklistoffset */
(
getiterfunc
)
takewhile_geti
ter
,
/* tp_iter */
PyObject_GenericGetI
ter
,
/* tp_iter */
(
iternextfunc
)
takewhile_next
,
/* tp_iternext */
(
iternextfunc
)
takewhile_next
,
/* tp_iternext */
0
,
/* tp_methods */
0
,
/* tp_methods */
0
,
/* tp_members */
0
,
/* tp_members */
...
@@ -589,13 +568,6 @@ islice_next(isliceobject *lz)
...
@@ -589,13 +568,6 @@ islice_next(isliceobject *lz)
return
item
;
return
item
;
}
}
static
PyObject
*
islice_getiter
(
PyObject
*
lz
)
{
Py_INCREF
(
lz
);
return
lz
;
}
PyDoc_STRVAR
(
islice_doc
,
PyDoc_STRVAR
(
islice_doc
,
"islice(iterable, [start,] stop [, step]) --> islice object
\n
\
"islice(iterable, [start,] stop [, step]) --> islice object
\n
\
\n
\
\n
\
...
@@ -635,7 +607,7 @@ PyTypeObject islice_type = {
...
@@ -635,7 +607,7 @@ PyTypeObject islice_type = {
0
,
/* tp_clear */
0
,
/* tp_clear */
0
,
/* tp_richcompare */
0
,
/* tp_richcompare */
0
,
/* tp_weaklistoffset */
0
,
/* tp_weaklistoffset */
(
getiterfunc
)
islice_geti
ter
,
/* tp_iter */
PyObject_GenericGetI
ter
,
/* tp_iter */
(
iternextfunc
)
islice_next
,
/* tp_iternext */
(
iternextfunc
)
islice_next
,
/* tp_iternext */
0
,
/* tp_methods */
0
,
/* tp_methods */
0
,
/* tp_members */
0
,
/* tp_members */
...
@@ -739,13 +711,6 @@ starmap_next(starmapobject *lz)
...
@@ -739,13 +711,6 @@ starmap_next(starmapobject *lz)
return
result
;
return
result
;
}
}
static
PyObject
*
starmap_getiter
(
PyObject
*
lz
)
{
Py_INCREF
(
lz
);
return
lz
;
}
PyDoc_STRVAR
(
starmap_doc
,
PyDoc_STRVAR
(
starmap_doc
,
"starmap(function, sequence) --> starmap object
\n
\
"starmap(function, sequence) --> starmap object
\n
\
\n
\
\n
\
...
@@ -781,7 +746,7 @@ PyTypeObject starmap_type = {
...
@@ -781,7 +746,7 @@ PyTypeObject starmap_type = {
0
,
/* tp_clear */
0
,
/* tp_clear */
0
,
/* tp_richcompare */
0
,
/* tp_richcompare */
0
,
/* tp_weaklistoffset */
0
,
/* tp_weaklistoffset */
(
getiterfunc
)
starmap_geti
ter
,
/* tp_iter */
PyObject_GenericGetI
ter
,
/* tp_iter */
(
iternextfunc
)
starmap_next
,
/* tp_iternext */
(
iternextfunc
)
starmap_next
,
/* tp_iternext */
0
,
/* tp_methods */
0
,
/* tp_methods */
0
,
/* tp_members */
0
,
/* tp_members */
...
@@ -930,13 +895,6 @@ imap_next(imapobject *lz)
...
@@ -930,13 +895,6 @@ imap_next(imapobject *lz)
return
result
;
return
result
;
}
}
static
PyObject
*
imap_getiter
(
PyObject
*
lz
)
{
Py_INCREF
(
lz
);
return
lz
;
}
PyDoc_STRVAR
(
imap_doc
,
PyDoc_STRVAR
(
imap_doc
,
"imap(func, *iterables) --> imap object
\n
\
"imap(func, *iterables) --> imap object
\n
\
\n
\
\n
\
...
@@ -975,7 +933,7 @@ PyTypeObject imap_type = {
...
@@ -975,7 +933,7 @@ PyTypeObject imap_type = {
0
,
/* tp_clear */
0
,
/* tp_clear */
0
,
/* tp_richcompare */
0
,
/* tp_richcompare */
0
,
/* tp_weaklistoffset */
0
,
/* tp_weaklistoffset */
(
getiterfunc
)
imap_geti
ter
,
/* tp_iter */
PyObject_GenericGetI
ter
,
/* tp_iter */
(
iternextfunc
)
imap_next
,
/* tp_iternext */
(
iternextfunc
)
imap_next
,
/* tp_iternext */
0
,
/* tp_methods */
0
,
/* tp_methods */
0
,
/* tp_members */
0
,
/* tp_members */
...
@@ -1074,13 +1032,6 @@ chain_next(chainobject *lz)
...
@@ -1074,13 +1032,6 @@ chain_next(chainobject *lz)
return
NULL
;
return
NULL
;
}
}
static
PyObject
*
chain_getiter
(
PyObject
*
lz
)
{
Py_INCREF
(
lz
);
return
lz
;
}
PyDoc_STRVAR
(
chain_doc
,
PyDoc_STRVAR
(
chain_doc
,
"chain(*iterables) --> chain object
\n
\
"chain(*iterables) --> chain object
\n
\
\n
\
\n
\
...
@@ -1117,7 +1068,7 @@ PyTypeObject chain_type = {
...
@@ -1117,7 +1068,7 @@ PyTypeObject chain_type = {
0
,
/* tp_clear */
0
,
/* tp_clear */
0
,
/* tp_richcompare */
0
,
/* tp_richcompare */
0
,
/* tp_weaklistoffset */
0
,
/* tp_weaklistoffset */
(
getiterfunc
)
chain_geti
ter
,
/* tp_iter */
PyObject_GenericGetI
ter
,
/* tp_iter */
(
iternextfunc
)
chain_next
,
/* tp_iternext */
(
iternextfunc
)
chain_next
,
/* tp_iternext */
0
,
/* tp_methods */
0
,
/* tp_methods */
0
,
/* tp_members */
0
,
/* tp_members */
...
@@ -1231,13 +1182,6 @@ ifilter_next(ifilterobject *lz)
...
@@ -1231,13 +1182,6 @@ ifilter_next(ifilterobject *lz)
}
}
}
}
static
PyObject
*
ifilter_getiter
(
PyObject
*
lz
)
{
Py_INCREF
(
lz
);
return
lz
;
}
PyDoc_STRVAR
(
ifilter_doc
,
PyDoc_STRVAR
(
ifilter_doc
,
"ifilter(function or None, sequence) --> ifilter object
\n
\
"ifilter(function or None, sequence) --> ifilter object
\n
\
\n
\
\n
\
...
@@ -1273,7 +1217,7 @@ PyTypeObject ifilter_type = {
...
@@ -1273,7 +1217,7 @@ PyTypeObject ifilter_type = {
0
,
/* tp_clear */
0
,
/* tp_clear */
0
,
/* tp_richcompare */
0
,
/* tp_richcompare */
0
,
/* tp_weaklistoffset */
0
,
/* tp_weaklistoffset */
(
getiterfunc
)
ifilter_geti
ter
,
/* tp_iter */
PyObject_GenericGetI
ter
,
/* tp_iter */
(
iternextfunc
)
ifilter_next
,
/* tp_iternext */
(
iternextfunc
)
ifilter_next
,
/* tp_iternext */
0
,
/* tp_methods */
0
,
/* tp_methods */
0
,
/* tp_members */
0
,
/* tp_members */
...
@@ -1387,13 +1331,6 @@ ifilterfalse_next(ifilterfalseobject *lz)
...
@@ -1387,13 +1331,6 @@ ifilterfalse_next(ifilterfalseobject *lz)
}
}
}
}
static
PyObject
*
ifilterfalse_getiter
(
PyObject
*
lz
)
{
Py_INCREF
(
lz
);
return
lz
;
}
PyDoc_STRVAR
(
ifilterfalse_doc
,
PyDoc_STRVAR
(
ifilterfalse_doc
,
"ifilterfalse(function or None, sequence) --> ifilterfalse object
\n
\
"ifilterfalse(function or None, sequence) --> ifilterfalse object
\n
\
\n
\
\n
\
...
@@ -1429,7 +1366,7 @@ PyTypeObject ifilterfalse_type = {
...
@@ -1429,7 +1366,7 @@ PyTypeObject ifilterfalse_type = {
0
,
/* tp_clear */
0
,
/* tp_clear */
0
,
/* tp_richcompare */
0
,
/* tp_richcompare */
0
,
/* tp_weaklistoffset */
0
,
/* tp_weaklistoffset */
(
getiterfunc
)
ifilterfalse_geti
ter
,
/* tp_iter */
PyObject_GenericGetI
ter
,
/* tp_iter */
(
iternextfunc
)
ifilterfalse_next
,
/* tp_iternext */
(
iternextfunc
)
ifilterfalse_next
,
/* tp_iternext */
0
,
/* tp_methods */
0
,
/* tp_methods */
0
,
/* tp_members */
0
,
/* tp_members */
...
@@ -1479,13 +1416,6 @@ count_next(countobject *lz)
...
@@ -1479,13 +1416,6 @@ count_next(countobject *lz)
return
PyInt_FromLong
(
lz
->
cnt
++
);
return
PyInt_FromLong
(
lz
->
cnt
++
);
}
}
static
PyObject
*
count_getiter
(
PyObject
*
lz
)
{
Py_INCREF
(
lz
);
return
lz
;
}
PyDoc_STRVAR
(
count_doc
,
PyDoc_STRVAR
(
count_doc
,
"count([firstval]) --> count object
\n
\
"count([firstval]) --> count object
\n
\
\n
\
\n
\
...
@@ -1520,7 +1450,7 @@ PyTypeObject count_type = {
...
@@ -1520,7 +1450,7 @@ PyTypeObject count_type = {
0
,
/* tp_clear */
0
,
/* tp_clear */
0
,
/* tp_richcompare */
0
,
/* tp_richcompare */
0
,
/* tp_weaklistoffset */
0
,
/* tp_weaklistoffset */
(
getiterfunc
)
count_geti
ter
,
/* tp_iter */
PyObject_GenericGetI
ter
,
/* tp_iter */
(
iternextfunc
)
count_next
,
/* tp_iternext */
(
iternextfunc
)
count_next
,
/* tp_iternext */
0
,
/* tp_methods */
0
,
/* tp_methods */
0
,
/* tp_members */
0
,
/* tp_members */
...
@@ -1665,13 +1595,6 @@ izip_next(izipobject *lz)
...
@@ -1665,13 +1595,6 @@ izip_next(izipobject *lz)
return
result
;
return
result
;
}
}
static
PyObject
*
izip_getiter
(
PyObject
*
lz
)
{
Py_INCREF
(
lz
);
return
lz
;
}
PyDoc_STRVAR
(
izip_doc
,
PyDoc_STRVAR
(
izip_doc
,
"izip(iter1 [,iter2 [...]]) --> izip object
\n
\
"izip(iter1 [,iter2 [...]]) --> izip object
\n
\
\n
\
\n
\
...
@@ -1711,7 +1634,7 @@ PyTypeObject izip_type = {
...
@@ -1711,7 +1634,7 @@ PyTypeObject izip_type = {
0
,
/* tp_clear */
0
,
/* tp_clear */
0
,
/* tp_richcompare */
0
,
/* tp_richcompare */
0
,
/* tp_weaklistoffset */
0
,
/* tp_weaklistoffset */
(
getiterfunc
)
izip_geti
ter
,
/* tp_iter */
PyObject_GenericGetI
ter
,
/* tp_iter */
(
iternextfunc
)
izip_next
,
/* tp_iternext */
(
iternextfunc
)
izip_next
,
/* tp_iternext */
0
,
/* tp_methods */
0
,
/* tp_methods */
0
,
/* tp_members */
0
,
/* tp_members */
...
@@ -1784,13 +1707,6 @@ repeat_next(repeatobject *ro)
...
@@ -1784,13 +1707,6 @@ repeat_next(repeatobject *ro)
return
ro
->
element
;
return
ro
->
element
;
}
}
static
PyObject
*
repeat_getiter
(
PyObject
*
ro
)
{
Py_INCREF
(
ro
);
return
ro
;
}
PyDoc_STRVAR
(
repeat_doc
,
PyDoc_STRVAR
(
repeat_doc
,
"repeat(element [,times]) -> create an iterator which returns the element
\n
\
"repeat(element [,times]) -> create an iterator which returns the element
\n
\
for the specified number of times. If not specified, returns the element
\n
\
for the specified number of times. If not specified, returns the element
\n
\
...
@@ -1825,7 +1741,7 @@ PyTypeObject repeat_type = {
...
@@ -1825,7 +1741,7 @@ PyTypeObject repeat_type = {
0
,
/* tp_clear */
0
,
/* tp_clear */
0
,
/* tp_richcompare */
0
,
/* tp_richcompare */
0
,
/* tp_weaklistoffset */
0
,
/* tp_weaklistoffset */
(
getiterfunc
)
repeat_geti
ter
,
/* tp_iter */
PyObject_GenericGetI
ter
,
/* tp_iter */
(
iternextfunc
)
repeat_next
,
/* tp_iternext */
(
iternextfunc
)
repeat_next
,
/* tp_iternext */
0
,
/* tp_methods */
0
,
/* tp_methods */
0
,
/* tp_members */
0
,
/* tp_members */
...
...
Objects/dictobject.c
Dosyayı görüntüle @
01538269
...
@@ -2013,13 +2013,6 @@ dictiter_dealloc(dictiterobject *di)
...
@@ -2013,13 +2013,6 @@ dictiter_dealloc(dictiterobject *di)
PyObject_Del
(
di
);
PyObject_Del
(
di
);
}
}
static
PyObject
*
dictiter_getiter
(
PyObject
*
it
)
{
Py_INCREF
(
it
);
return
it
;
}
static
PyObject
*
dictiter_iternext
(
dictiterobject
*
di
)
static
PyObject
*
dictiter_iternext
(
dictiterobject
*
di
)
{
{
PyObject
*
key
,
*
value
;
PyObject
*
key
,
*
value
;
...
@@ -2069,7 +2062,7 @@ PyTypeObject PyDictIter_Type = {
...
@@ -2069,7 +2062,7 @@ PyTypeObject PyDictIter_Type = {
0
,
/* tp_clear */
0
,
/* tp_clear */
0
,
/* tp_richcompare */
0
,
/* tp_richcompare */
0
,
/* tp_weaklistoffset */
0
,
/* tp_weaklistoffset */
(
getiterfunc
)
dictiter_geti
ter
,
/* tp_iter */
PyObject_GenericGetI
ter
,
/* tp_iter */
(
iternextfunc
)
dictiter_iternext
,
/* tp_iternext */
(
iternextfunc
)
dictiter_iternext
,
/* tp_iternext */
0
,
/* tp_methods */
0
,
/* tp_methods */
0
,
/* tp_members */
0
,
/* tp_members */
...
...
Objects/enumobject.c
Dosyayı görüntüle @
01538269
...
@@ -78,13 +78,6 @@ enum_next(enumobject *en)
...
@@ -78,13 +78,6 @@ enum_next(enumobject *en)
return
result
;
return
result
;
}
}
static
PyObject
*
enum_getiter
(
PyObject
*
en
)
{
Py_INCREF
(
en
);
return
en
;
}
PyDoc_STRVAR
(
enum_doc
,
PyDoc_STRVAR
(
enum_doc
,
"enumerate(iterable) -> create an enumerating-iterator"
);
"enumerate(iterable) -> create an enumerating-iterator"
);
...
@@ -117,7 +110,7 @@ PyTypeObject PyEnum_Type = {
...
@@ -117,7 +110,7 @@ PyTypeObject PyEnum_Type = {
0
,
/* tp_clear */
0
,
/* tp_clear */
0
,
/* tp_richcompare */
0
,
/* tp_richcompare */
0
,
/* tp_weaklistoffset */
0
,
/* tp_weaklistoffset */
(
getiterfunc
)
enum_getiter
,
/* tp_iter */
PyObject_GenericGetIter
,
/* tp_iter */
(
iternextfunc
)
enum_next
,
/* tp_iternext */
(
iternextfunc
)
enum_next
,
/* tp_iternext */
0
,
/* tp_methods */
0
,
/* tp_methods */
0
,
/* tp_members */
0
,
/* tp_members */
...
...
Objects/iterobject.c
Dosyayı görüntüle @
01538269
...
@@ -43,13 +43,6 @@ iter_traverse(seqiterobject *it, visitproc visit, void *arg)
...
@@ -43,13 +43,6 @@ iter_traverse(seqiterobject *it, visitproc visit, void *arg)
return
visit
(
it
->
it_seq
,
arg
);
return
visit
(
it
->
it_seq
,
arg
);
}
}
static
PyObject
*
iter_getiter
(
PyObject
*
it
)
{
Py_INCREF
(
it
);
return
it
;
}
static
PyObject
*
static
PyObject
*
iter_iternext
(
PyObject
*
iterator
)
iter_iternext
(
PyObject
*
iterator
)
{
{
...
@@ -106,7 +99,7 @@ PyTypeObject PySeqIter_Type = {
...
@@ -106,7 +99,7 @@ PyTypeObject PySeqIter_Type = {
0
,
/* tp_clear */
0
,
/* tp_clear */
0
,
/* tp_richcompare */
0
,
/* tp_richcompare */
0
,
/* tp_weaklistoffset */
0
,
/* tp_weaklistoffset */
(
getiterfunc
)
iter_geti
ter
,
/* tp_iter */
PyObject_GenericGetI
ter
,
/* tp_iter */
(
iternextfunc
)
iter_iternext
,
/* tp_iternext */
(
iternextfunc
)
iter_iternext
,
/* tp_iternext */
0
,
/* tp_methods */
0
,
/* tp_methods */
0
,
/* tp_members */
0
,
/* tp_members */
...
@@ -223,7 +216,7 @@ PyTypeObject PyCallIter_Type = {
...
@@ -223,7 +216,7 @@ PyTypeObject PyCallIter_Type = {
0
,
/* tp_clear */
0
,
/* tp_clear */
0
,
/* tp_richcompare */
0
,
/* tp_richcompare */
0
,
/* tp_weaklistoffset */
0
,
/* tp_weaklistoffset */
(
getiterfunc
)
iter_geti
ter
,
/* tp_iter */
PyObject_GenericGetI
ter
,
/* tp_iter */
(
iternextfunc
)
calliter_iternext
,
/* tp_iternext */
(
iternextfunc
)
calliter_iternext
,
/* tp_iternext */
0
,
/* tp_methods */
0
,
/* tp_methods */
0
,
/* tp_members */
0
,
/* tp_members */
...
...
Objects/listobject.c
Dosyayı görüntüle @
01538269
...
@@ -2398,14 +2398,6 @@ listiter_traverse(listiterobject *it, visitproc visit, void *arg)
...
@@ -2398,14 +2398,6 @@ listiter_traverse(listiterobject *it, visitproc visit, void *arg)
return
visit
((
PyObject
*
)
it
->
it_seq
,
arg
);
return
visit
((
PyObject
*
)
it
->
it_seq
,
arg
);
}
}
static
PyObject
*
listiter_getiter
(
PyObject
*
it
)
{
Py_INCREF
(
it
);
return
it
;
}
static
PyObject
*
static
PyObject
*
listiter_next
(
listiterobject
*
it
)
listiter_next
(
listiterobject
*
it
)
{
{
...
@@ -2458,7 +2450,7 @@ PyTypeObject PyListIter_Type = {
...
@@ -2458,7 +2450,7 @@ PyTypeObject PyListIter_Type = {
0
,
/* tp_clear */
0
,
/* tp_clear */
0
,
/* tp_richcompare */
0
,
/* tp_richcompare */
0
,
/* tp_weaklistoffset */
0
,
/* tp_weaklistoffset */
(
getiterfunc
)
listiter_geti
ter
,
/* tp_iter */
PyObject_GenericGetI
ter
,
/* tp_iter */
(
iternextfunc
)
listiter_next
,
/* tp_iternext */
(
iternextfunc
)
listiter_next
,
/* tp_iternext */
0
,
/* tp_methods */
0
,
/* tp_methods */
0
,
/* tp_members */
0
,
/* tp_members */
...
...
Objects/object.c
Dosyayı görüntüle @
01538269
...
@@ -1300,6 +1300,13 @@ _PyObject_GetDictPtr(PyObject *obj)
...
@@ -1300,6 +1300,13 @@ _PyObject_GetDictPtr(PyObject *obj)
/* Generic GetAttr functions - put these in your tp_[gs]etattro slot */
/* Generic GetAttr functions - put these in your tp_[gs]etattro slot */
PyObject
*
PyObject_GenericGetIter
(
PyObject
*
obj
)
{
Py_INCREF
(
obj
);
return
obj
;
}
PyObject
*
PyObject
*
PyObject_GenericGetAttr
(
PyObject
*
obj
,
PyObject
*
name
)
PyObject_GenericGetAttr
(
PyObject
*
obj
,
PyObject
*
name
)
{
{
...
...
Objects/rangeobject.c
Dosyayı görüntüle @
01538269
...
@@ -245,13 +245,6 @@ range_iter(PyObject *seq)
...
@@ -245,13 +245,6 @@ range_iter(PyObject *seq)
return
(
PyObject
*
)
it
;
return
(
PyObject
*
)
it
;
}
}
static
PyObject
*
rangeiter_getiter
(
PyObject
*
it
)
{
Py_INCREF
(
it
);
return
it
;
}
static
PyObject
*
static
PyObject
*
rangeiter_next
(
rangeiterobject
*
r
)
rangeiter_next
(
rangeiterobject
*
r
)
{
{
...
@@ -288,7 +281,7 @@ static PyTypeObject Pyrangeiter_Type = {
...
@@ -288,7 +281,7 @@ static PyTypeObject Pyrangeiter_Type = {
0
,
/* tp_clear */
0
,
/* tp_clear */
0
,
/* tp_richcompare */
0
,
/* tp_richcompare */
0
,
/* tp_weaklistoffset */
0
,
/* tp_weaklistoffset */
(
getiterfunc
)
rangeiter_geti
ter
,
/* tp_iter */
PyObject_GenericGetI
ter
,
/* tp_iter */
(
iternextfunc
)
rangeiter_next
,
/* tp_iternext */
(
iternextfunc
)
rangeiter_next
,
/* tp_iternext */
0
,
/* tp_methods */
0
,
/* tp_methods */
};
};
Objects/tupleobject.c
Dosyayı görüntüle @
01538269
...
@@ -779,14 +779,6 @@ tupleiter_traverse(tupleiterobject *it, visitproc visit, void *arg)
...
@@ -779,14 +779,6 @@ tupleiter_traverse(tupleiterobject *it, visitproc visit, void *arg)
return
visit
((
PyObject
*
)
it
->
it_seq
,
arg
);
return
visit
((
PyObject
*
)
it
->
it_seq
,
arg
);
}
}
static
PyObject
*
tupleiter_getiter
(
PyObject
*
it
)
{
Py_INCREF
(
it
);
return
it
;
}
static
PyObject
*
static
PyObject
*
tupleiter_next
(
tupleiterobject
*
it
)
tupleiter_next
(
tupleiterobject
*
it
)
{
{
...
@@ -839,6 +831,6 @@ PyTypeObject PyTupleIter_Type = {
...
@@ -839,6 +831,6 @@ PyTypeObject PyTupleIter_Type = {
0
,
/* tp_clear */
0
,
/* tp_clear */
0
,
/* tp_richcompare */
0
,
/* tp_richcompare */
0
,
/* tp_weaklistoffset */
0
,
/* tp_weaklistoffset */
(
getiterfunc
)
tupleiter_geti
ter
,
/* tp_iter */
PyObject_GenericGetI
ter
,
/* tp_iter */
(
iternextfunc
)
tupleiter_next
,
/* tp_iternext */
(
iternextfunc
)
tupleiter_next
,
/* tp_iternext */
};
};
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