mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
Remove "static forward" declaration. Move constructors
after the type objects.
This commit is contained in:
parent
9eec489c4a
commit
72d206776d
3 changed files with 79 additions and 85 deletions
|
@ -3,7 +3,7 @@
|
|||
Written and maintained by Raymond D. Hettinger <python@rcn.com>
|
||||
Derived from Lib/sets.py and Objects/dictobject.c.
|
||||
|
||||
Copyright (c) 2003-5 Python Software Foundation.
|
||||
Copyright (c) 2003-6 Python Software Foundation.
|
||||
All rights reserved.
|
||||
*/
|
||||
|
||||
|
@ -719,8 +719,6 @@ set_nohash(PyObject *self)
|
|||
|
||||
/***** Set iterator type ***********************************************/
|
||||
|
||||
static PyTypeObject PySetIter_Type; /* Forward */
|
||||
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
PySetObject *si_set; /* Set to NULL when iterator is exhausted */
|
||||
|
@ -729,20 +727,6 @@ typedef struct {
|
|||
long len;
|
||||
} setiterobject;
|
||||
|
||||
static PyObject *
|
||||
set_iter(PySetObject *so)
|
||||
{
|
||||
setiterobject *si = PyObject_New(setiterobject, &PySetIter_Type);
|
||||
if (si == NULL)
|
||||
return NULL;
|
||||
Py_INCREF(so);
|
||||
si->si_set = so;
|
||||
si->si_used = so->used;
|
||||
si->si_pos = 0;
|
||||
si->len = so->used;
|
||||
return (PyObject *)si;
|
||||
}
|
||||
|
||||
static void
|
||||
setiter_dealloc(setiterobject *si)
|
||||
{
|
||||
|
@ -838,6 +822,20 @@ static PyTypeObject PySetIter_Type = {
|
|||
0,
|
||||
};
|
||||
|
||||
static PyObject *
|
||||
set_iter(PySetObject *so)
|
||||
{
|
||||
setiterobject *si = PyObject_New(setiterobject, &PySetIter_Type);
|
||||
if (si == NULL)
|
||||
return NULL;
|
||||
Py_INCREF(so);
|
||||
si->si_set = so;
|
||||
si->si_used = so->used;
|
||||
si->si_pos = 0;
|
||||
si->len = so->used;
|
||||
return (PyObject *)si;
|
||||
}
|
||||
|
||||
static int
|
||||
set_update_internal(PySetObject *so, PyObject *other)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue