Mercurial > cpython-lru_cache-weakref
annotate Include/setobject.h @ 32527:0da660e05e69 legacy-trunk
"#if WITH_THREAD" is incorrect; must be #ifdef instead; WITH_THREAD
isn't always set to an integer value when it's defined.
| author | Tim Peters <tim.peters@gmail.com> |
|---|---|
| date | Wed, 07 Jul 2004 20:42:07 +0000 |
| parents | 679e5c8effae |
| children | 60c60dc75c77 |
| rev | line source |
|---|---|
|
30929
54ff68e973ee
* Migrate set() and frozenset() from the sandbox.
Raymond Hettinger <python@rcn.com>
parents:
diff
changeset
|
1 |
|
54ff68e973ee
* Migrate set() and frozenset() from the sandbox.
Raymond Hettinger <python@rcn.com>
parents:
diff
changeset
|
2 /* Set object interface */ |
|
54ff68e973ee
* Migrate set() and frozenset() from the sandbox.
Raymond Hettinger <python@rcn.com>
parents:
diff
changeset
|
3 |
|
54ff68e973ee
* Migrate set() and frozenset() from the sandbox.
Raymond Hettinger <python@rcn.com>
parents:
diff
changeset
|
4 #ifndef Py_SETOBJECT_H |
|
54ff68e973ee
* Migrate set() and frozenset() from the sandbox.
Raymond Hettinger <python@rcn.com>
parents:
diff
changeset
|
5 #define Py_SETOBJECT_H |
|
54ff68e973ee
* Migrate set() and frozenset() from the sandbox.
Raymond Hettinger <python@rcn.com>
parents:
diff
changeset
|
6 #ifdef __cplusplus |
|
54ff68e973ee
* Migrate set() and frozenset() from the sandbox.
Raymond Hettinger <python@rcn.com>
parents:
diff
changeset
|
7 extern "C" { |
|
54ff68e973ee
* Migrate set() and frozenset() from the sandbox.
Raymond Hettinger <python@rcn.com>
parents:
diff
changeset
|
8 #endif |
|
54ff68e973ee
* Migrate set() and frozenset() from the sandbox.
Raymond Hettinger <python@rcn.com>
parents:
diff
changeset
|
9 |
|
54ff68e973ee
* Migrate set() and frozenset() from the sandbox.
Raymond Hettinger <python@rcn.com>
parents:
diff
changeset
|
10 /* |
|
54ff68e973ee
* Migrate set() and frozenset() from the sandbox.
Raymond Hettinger <python@rcn.com>
parents:
diff
changeset
|
11 This data structure is shared by set and frozenset objects. |
|
54ff68e973ee
* Migrate set() and frozenset() from the sandbox.
Raymond Hettinger <python@rcn.com>
parents:
diff
changeset
|
12 */ |
|
54ff68e973ee
* Migrate set() and frozenset() from the sandbox.
Raymond Hettinger <python@rcn.com>
parents:
diff
changeset
|
13 |
|
54ff68e973ee
* Migrate set() and frozenset() from the sandbox.
Raymond Hettinger <python@rcn.com>
parents:
diff
changeset
|
14 typedef struct { |
|
54ff68e973ee
* Migrate set() and frozenset() from the sandbox.
Raymond Hettinger <python@rcn.com>
parents:
diff
changeset
|
15 PyObject_HEAD |
|
54ff68e973ee
* Migrate set() and frozenset() from the sandbox.
Raymond Hettinger <python@rcn.com>
parents:
diff
changeset
|
16 PyObject *data; |
|
54ff68e973ee
* Migrate set() and frozenset() from the sandbox.
Raymond Hettinger <python@rcn.com>
parents:
diff
changeset
|
17 long hash; /* only used by frozenset objects */ |
|
32158
679e5c8effae
Make sets and deques weak referencable.
Raymond Hettinger <python@rcn.com>
parents:
31008
diff
changeset
|
18 PyObject *weakreflist; /* List of weak references */ |
|
30929
54ff68e973ee
* Migrate set() and frozenset() from the sandbox.
Raymond Hettinger <python@rcn.com>
parents:
diff
changeset
|
19 } PySetObject; |
|
54ff68e973ee
* Migrate set() and frozenset() from the sandbox.
Raymond Hettinger <python@rcn.com>
parents:
diff
changeset
|
20 |
|
54ff68e973ee
* Migrate set() and frozenset() from the sandbox.
Raymond Hettinger <python@rcn.com>
parents:
diff
changeset
|
21 PyAPI_DATA(PyTypeObject) PySet_Type; |
|
54ff68e973ee
* Migrate set() and frozenset() from the sandbox.
Raymond Hettinger <python@rcn.com>
parents:
diff
changeset
|
22 PyAPI_DATA(PyTypeObject) PyFrozenSet_Type; |
|
54ff68e973ee
* Migrate set() and frozenset() from the sandbox.
Raymond Hettinger <python@rcn.com>
parents:
diff
changeset
|
23 |
|
31008
4224d807911c
* Checkin remaining documentation
Raymond Hettinger <python@rcn.com>
parents:
30931
diff
changeset
|
24 #define PyFrozenSet_CheckExact(ob) ((ob)->ob_type == &PyFrozenSet_Type) |
|
30931
fa6e8d4f88c6
Various fixups (most suggested by Armin Rigo).
Raymond Hettinger <python@rcn.com>
parents:
30929
diff
changeset
|
25 #define PyAnySet_Check(ob) \ |
|
fa6e8d4f88c6
Various fixups (most suggested by Armin Rigo).
Raymond Hettinger <python@rcn.com>
parents:
30929
diff
changeset
|
26 ((ob)->ob_type == &PySet_Type || (ob)->ob_type == &PyFrozenSet_Type || \ |
|
fa6e8d4f88c6
Various fixups (most suggested by Armin Rigo).
Raymond Hettinger <python@rcn.com>
parents:
30929
diff
changeset
|
27 PyType_IsSubtype((ob)->ob_type, &PySet_Type) || \ |
|
fa6e8d4f88c6
Various fixups (most suggested by Armin Rigo).
Raymond Hettinger <python@rcn.com>
parents:
30929
diff
changeset
|
28 PyType_IsSubtype((ob)->ob_type, &PyFrozenSet_Type)) |
|
fa6e8d4f88c6
Various fixups (most suggested by Armin Rigo).
Raymond Hettinger <python@rcn.com>
parents:
30929
diff
changeset
|
29 |
|
30929
54ff68e973ee
* Migrate set() and frozenset() from the sandbox.
Raymond Hettinger <python@rcn.com>
parents:
diff
changeset
|
30 #ifdef __cplusplus |
|
54ff68e973ee
* Migrate set() and frozenset() from the sandbox.
Raymond Hettinger <python@rcn.com>
parents:
diff
changeset
|
31 } |
|
54ff68e973ee
* Migrate set() and frozenset() from the sandbox.
Raymond Hettinger <python@rcn.com>
parents:
diff
changeset
|
32 #endif |
|
54ff68e973ee
* Migrate set() and frozenset() from the sandbox.
Raymond Hettinger <python@rcn.com>
parents:
diff
changeset
|
33 #endif /* !Py_SETOBJECT_H */ |
