Mercurial > cpython-lru_cache-weakref
annotate Include/dictobject.h @ 87690:66c1c9f32567 default tip
Add use_weakref option to functools.lru_cache
The use_weakref option makes lru_cache create weak references to the function
arguments when creating the cache key, which prevents them from staying in the
memory forever even after all other references to them are gone.
This is a proof of concept for http://bugs.python.org/issue19859
| author | Radomir Dopieralski <devel@sheep.art.pl> |
|---|---|
| date | Tue, 03 Dec 2013 16:02:48 +0100 |
| parents | bf9c77bac36d |
| children |
| rev | line source |
|---|---|
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
1 #ifndef Py_DICTOBJECT_H |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
2 #define Py_DICTOBJECT_H |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
3 #ifdef __cplusplus |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
4 extern "C" { |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
5 #endif |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
6 |
| 145 | 7 |
|
5508
3643f19d5ca1
Subsumed mappingobject.h in dictobject.h.
Guido van Rossum <guido@python.org>
parents:
4503
diff
changeset
|
8 /* Dictionary object type -- mapping from hashable object to object */ |
|
3643f19d5ca1
Subsumed mappingobject.h in dictobject.h.
Guido van Rossum <guido@python.org>
parents:
4503
diff
changeset
|
9 |
|
28946
dbdeb734ff97
Add a reference to dictnotes.txt. It does no good if you don't know it's
Raymond Hettinger <python@rcn.com>
parents:
26599
diff
changeset
|
10 /* The distribution includes a separate file, Objects/dictnotes.txt, |
|
38499
494cab563c11
Convert relevant dict internals to Py_ssize_t.
Tim Peters <tim.peters@gmail.com>
parents:
36501
diff
changeset
|
11 describing explorations into dictionary design and optimization. |
|
28946
dbdeb734ff97
Add a reference to dictnotes.txt. It does no good if you don't know it's
Raymond Hettinger <python@rcn.com>
parents:
26599
diff
changeset
|
12 It covers typical dictionary use patterns, the parameters for |
|
dbdeb734ff97
Add a reference to dictnotes.txt. It does no good if you don't know it's
Raymond Hettinger <python@rcn.com>
parents:
26599
diff
changeset
|
13 tuning dictionaries, and several ideas for possible optimizations. |
|
dbdeb734ff97
Add a reference to dictnotes.txt. It does no good if you don't know it's
Raymond Hettinger <python@rcn.com>
parents:
26599
diff
changeset
|
14 */ |
|
dbdeb734ff97
Add a reference to dictnotes.txt. It does no good if you don't know it's
Raymond Hettinger <python@rcn.com>
parents:
26599
diff
changeset
|
15 |
|
76485
6e5855854a2e
Implement PEP 412: Key-sharing dictionaries (closes #13903)
Benjamin Peterson <benjamin@python.org>
parents:
76303
diff
changeset
|
16 #ifndef Py_LIMITED_API |
|
18933
09df3254b49d
Merge of descr-branch back into trunk.
Tim Peters <tim.peters@gmail.com>
parents:
14375
diff
changeset
|
17 |
|
76485
6e5855854a2e
Implement PEP 412: Key-sharing dictionaries (closes #13903)
Benjamin Peterson <benjamin@python.org>
parents:
76303
diff
changeset
|
18 typedef struct _dictkeysobject PyDictKeysObject; |
|
18933
09df3254b49d
Merge of descr-branch back into trunk.
Tim Peters <tim.peters@gmail.com>
parents:
14375
diff
changeset
|
19 |
|
76485
6e5855854a2e
Implement PEP 412: Key-sharing dictionaries (closes #13903)
Benjamin Peterson <benjamin@python.org>
parents:
76303
diff
changeset
|
20 /* The ma_values pointer is NULL for a combined table |
|
6e5855854a2e
Implement PEP 412: Key-sharing dictionaries (closes #13903)
Benjamin Peterson <benjamin@python.org>
parents:
76303
diff
changeset
|
21 * or points to an array of PyObject* for a split table |
|
18933
09df3254b49d
Merge of descr-branch back into trunk.
Tim Peters <tim.peters@gmail.com>
parents:
14375
diff
changeset
|
22 */ |
|
09df3254b49d
Merge of descr-branch back into trunk.
Tim Peters <tim.peters@gmail.com>
parents:
14375
diff
changeset
|
23 typedef struct { |
|
76485
6e5855854a2e
Implement PEP 412: Key-sharing dictionaries (closes #13903)
Benjamin Peterson <benjamin@python.org>
parents:
76303
diff
changeset
|
24 PyObject_HEAD |
|
6e5855854a2e
Implement PEP 412: Key-sharing dictionaries (closes #13903)
Benjamin Peterson <benjamin@python.org>
parents:
76303
diff
changeset
|
25 Py_ssize_t ma_used; |
|
6e5855854a2e
Implement PEP 412: Key-sharing dictionaries (closes #13903)
Benjamin Peterson <benjamin@python.org>
parents:
76303
diff
changeset
|
26 PyDictKeysObject *ma_keys; |
|
6e5855854a2e
Implement PEP 412: Key-sharing dictionaries (closes #13903)
Benjamin Peterson <benjamin@python.org>
parents:
76303
diff
changeset
|
27 PyObject **ma_values; |
|
6e5855854a2e
Implement PEP 412: Key-sharing dictionaries (closes #13903)
Benjamin Peterson <benjamin@python.org>
parents:
76303
diff
changeset
|
28 } PyDictObject; |
|
18933
09df3254b49d
Merge of descr-branch back into trunk.
Tim Peters <tim.peters@gmail.com>
parents:
14375
diff
changeset
|
29 |
|
66664
62b61abd02b8
Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents:
65494
diff
changeset
|
30 #endif /* Py_LIMITED_API */ |
|
18933
09df3254b49d
Merge of descr-branch back into trunk.
Tim Peters <tim.peters@gmail.com>
parents:
14375
diff
changeset
|
31 |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
22956
diff
changeset
|
32 PyAPI_DATA(PyTypeObject) PyDict_Type; |
|
44061
0cc552ab76bd
Added all PyTypeObjects to the appropriate header files.
Christian Heimes <christian@cheimes.de>
parents:
42334
diff
changeset
|
33 PyAPI_DATA(PyTypeObject) PyDictIterKey_Type; |
|
0cc552ab76bd
Added all PyTypeObjects to the appropriate header files.
Christian Heimes <christian@cheimes.de>
parents:
42334
diff
changeset
|
34 PyAPI_DATA(PyTypeObject) PyDictIterValue_Type; |
|
0cc552ab76bd
Added all PyTypeObjects to the appropriate header files.
Christian Heimes <christian@cheimes.de>
parents:
42334
diff
changeset
|
35 PyAPI_DATA(PyTypeObject) PyDictIterItem_Type; |
|
0cc552ab76bd
Added all PyTypeObjects to the appropriate header files.
Christian Heimes <christian@cheimes.de>
parents:
42334
diff
changeset
|
36 PyAPI_DATA(PyTypeObject) PyDictKeys_Type; |
|
0cc552ab76bd
Added all PyTypeObjects to the appropriate header files.
Christian Heimes <christian@cheimes.de>
parents:
42334
diff
changeset
|
37 PyAPI_DATA(PyTypeObject) PyDictItems_Type; |
|
0cc552ab76bd
Added all PyTypeObjects to the appropriate header files.
Christian Heimes <christian@cheimes.de>
parents:
42334
diff
changeset
|
38 PyAPI_DATA(PyTypeObject) PyDictValues_Type; |
|
5508
3643f19d5ca1
Subsumed mappingobject.h in dictobject.h.
Guido van Rossum <guido@python.org>
parents:
4503
diff
changeset
|
39 |
|
40908
d01bd37bf5ce
Variation of patch # 1624059 to speed up checking if an object is a subclass
Neal Norwitz <nnorwitz@gmail.com>
parents:
40864
diff
changeset
|
40 #define PyDict_Check(op) \ |
|
44351
86a2679dca46
#1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT.
Christian Heimes <christian@cheimes.de>
parents:
44349
diff
changeset
|
41 PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_DICT_SUBCLASS) |
|
86a2679dca46
#1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT.
Christian Heimes <christian@cheimes.de>
parents:
44349
diff
changeset
|
42 #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) |
|
86a2679dca46
#1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT.
Christian Heimes <christian@cheimes.de>
parents:
44349
diff
changeset
|
43 #define PyDictKeys_Check(op) (Py_TYPE(op) == &PyDictKeys_Type) |
|
86a2679dca46
#1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT.
Christian Heimes <christian@cheimes.de>
parents:
44349
diff
changeset
|
44 #define PyDictItems_Check(op) (Py_TYPE(op) == &PyDictItems_Type) |
|
86a2679dca46
#1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT.
Christian Heimes <christian@cheimes.de>
parents:
44349
diff
changeset
|
45 #define PyDictValues_Check(op) (Py_TYPE(op) == &PyDictValues_Type) |
|
44061
0cc552ab76bd
Added all PyTypeObjects to the appropriate header files.
Christian Heimes <christian@cheimes.de>
parents:
42334
diff
changeset
|
46 /* This excludes Values, since they are not sets. */ |
|
0cc552ab76bd
Added all PyTypeObjects to the appropriate header files.
Christian Heimes <christian@cheimes.de>
parents:
42334
diff
changeset
|
47 # define PyDictViewSet_Check(op) \ |
|
61467
f197407bdba2
Recorded merge of revisions 81032 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
52291
diff
changeset
|
48 (PyDictKeys_Check(op) || PyDictItems_Check(op)) |
|
44061
0cc552ab76bd
Added all PyTypeObjects to the appropriate header files.
Christian Heimes <christian@cheimes.de>
parents:
42334
diff
changeset
|
49 |
|
1257
1cabc2b6c970
* Changed all copyright messages to include 1993.
Guido van Rossum <guido@python.org>
parents:
790
diff
changeset
|
50 |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
22956
diff
changeset
|
51 PyAPI_FUNC(PyObject *) PyDict_New(void); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
22956
diff
changeset
|
52 PyAPI_FUNC(PyObject *) PyDict_GetItem(PyObject *mp, PyObject *key); |
|
47410
1bdf07409403
Added missing prototype for PyDict_GetItemWithError().
Alexandre Vassalotti <alexandre@peadrop.com>
parents:
44351
diff
changeset
|
53 PyAPI_FUNC(PyObject *) PyDict_GetItemWithError(PyObject *mp, PyObject *key); |
|
76303
2dd046be2c88
Issue #2377: Make importlib the implementation of __import__().
Brett Cannon <brett@python.org>
parents:
75959
diff
changeset
|
54 PyAPI_FUNC(PyObject *) _PyDict_GetItemIdWithError(PyObject *dp, |
|
2dd046be2c88
Issue #2377: Make importlib the implementation of __import__().
Brett Cannon <brett@python.org>
parents:
75959
diff
changeset
|
55 struct _Py_Identifier *key); |
|
82542
a0b750ea3397
Add PyDict_SetDefault. (closes #17327)
Benjamin Peterson <benjamin@python.org>
parents:
77577
diff
changeset
|
56 PyAPI_FUNC(PyObject *) PyDict_SetDefault( |
|
a0b750ea3397
Add PyDict_SetDefault. (closes #17327)
Benjamin Peterson <benjamin@python.org>
parents:
77577
diff
changeset
|
57 PyObject *mp, PyObject *key, PyObject *defaultobj); |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
22956
diff
changeset
|
58 PyAPI_FUNC(int) PyDict_SetItem(PyObject *mp, PyObject *key, PyObject *item); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
22956
diff
changeset
|
59 PyAPI_FUNC(int) PyDict_DelItem(PyObject *mp, PyObject *key); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
22956
diff
changeset
|
60 PyAPI_FUNC(void) PyDict_Clear(PyObject *mp); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
22956
diff
changeset
|
61 PyAPI_FUNC(int) PyDict_Next( |
|
61467
f197407bdba2
Recorded merge of revisions 81032 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
52291
diff
changeset
|
62 PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value); |
|
66664
62b61abd02b8
Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents:
65494
diff
changeset
|
63 #ifndef Py_LIMITED_API |
|
76485
6e5855854a2e
Implement PEP 412: Key-sharing dictionaries (closes #13903)
Benjamin Peterson <benjamin@python.org>
parents:
76303
diff
changeset
|
64 PyDictKeysObject *_PyDict_NewKeysForClass(void); |
|
6e5855854a2e
Implement PEP 412: Key-sharing dictionaries (closes #13903)
Benjamin Peterson <benjamin@python.org>
parents:
76303
diff
changeset
|
65 PyAPI_FUNC(PyObject *) PyObject_GenericGetDict(PyObject *, void *); |
|
40864
b0f8e9b0cc19
Extend work on revision 52962: Eliminate redundant calls to PyObject_Hash().
Raymond Hettinger <python@rcn.com>
parents:
38499
diff
changeset
|
66 PyAPI_FUNC(int) _PyDict_Next( |
|
65494
e8969fb822fc
make hashes always the size of pointers; introduce Py_hash_t #9778
Benjamin Peterson <benjamin@python.org>
parents:
61466
diff
changeset
|
67 PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value, Py_hash_t *hash); |
|
66664
62b61abd02b8
Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents:
65494
diff
changeset
|
68 #endif |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
22956
diff
changeset
|
69 PyAPI_FUNC(PyObject *) PyDict_Keys(PyObject *mp); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
22956
diff
changeset
|
70 PyAPI_FUNC(PyObject *) PyDict_Values(PyObject *mp); |
|
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
22956
diff
changeset
|
71 PyAPI_FUNC(PyObject *) PyDict_Items(PyObject *mp); |
|
36501
7fdc639bc5b4
Merge ssize_t branch.
Martin v. Löwis <martin@v.loewis.de>
parents:
31269
diff
changeset
|
72 PyAPI_FUNC(Py_ssize_t) PyDict_Size(PyObject *mp); |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
22956
diff
changeset
|
73 PyAPI_FUNC(PyObject *) PyDict_Copy(PyObject *mp); |
|
31019
b2fd7af17186
Expose dict_contains() and PyDict_Contains() with is about 10% faster
Raymond Hettinger <python@rcn.com>
parents:
28946
diff
changeset
|
74 PyAPI_FUNC(int) PyDict_Contains(PyObject *mp, PyObject *key); |
|
66664
62b61abd02b8
Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents:
65494
diff
changeset
|
75 #ifndef Py_LIMITED_API |
|
65494
e8969fb822fc
make hashes always the size of pointers; introduce Py_hash_t #9778
Benjamin Peterson <benjamin@python.org>
parents:
61466
diff
changeset
|
76 PyAPI_FUNC(int) _PyDict_Contains(PyObject *mp, PyObject *key, Py_hash_t hash); |
|
44349
4dc01402d78a
Merged revisions 59541-59561 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
44061
diff
changeset
|
77 PyAPI_FUNC(PyObject *) _PyDict_NewPresized(Py_ssize_t minused); |
|
52291
94bd0666ffa7
Merged revisions 70546 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
47410
diff
changeset
|
78 PyAPI_FUNC(void) _PyDict_MaybeUntrack(PyObject *mp); |
|
60931
79128efe8a99
prevent the dict constructor from accepting non-string keyword args #8419
Benjamin Peterson <benjamin@python.org>
parents:
52291
diff
changeset
|
79 PyAPI_FUNC(int) _PyDict_HasOnlyStringKeys(PyObject *mp); |
|
76530
b044e0568be2
Account for shared keys in type's __sizeof__ (#13903).
Martin v. Loewis <martin@v.loewis.de>
parents:
76485
diff
changeset
|
80 Py_ssize_t _PyDict_KeysSize(PyDictKeysObject *keys); |
|
76485
6e5855854a2e
Implement PEP 412: Key-sharing dictionaries (closes #13903)
Benjamin Peterson <benjamin@python.org>
parents:
76303
diff
changeset
|
81 #define _PyDict_HasSplitTable(d) ((d)->ma_values != NULL) |
|
73551
910986542a75
Issue #13389: Full garbage collection passes now clear the freelists for
Antoine Pitrou <solipsis@pitrou.net>
parents:
68257
diff
changeset
|
82 |
|
910986542a75
Issue #13389: Full garbage collection passes now clear the freelists for
Antoine Pitrou <solipsis@pitrou.net>
parents:
68257
diff
changeset
|
83 PyAPI_FUNC(int) PyDict_ClearFreeList(void); |
|
66664
62b61abd02b8
Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents:
65494
diff
changeset
|
84 #endif |
|
21348
12310d643d8d
SF bug #491415 PyDict_UpdateFromSeq2() unused
Tim Peters <tim.peters@gmail.com>
parents:
19150
diff
changeset
|
85 |
|
12310d643d8d
SF bug #491415 PyDict_UpdateFromSeq2() unused
Tim Peters <tim.peters@gmail.com>
parents:
19150
diff
changeset
|
86 /* PyDict_Update(mp, other) is equivalent to PyDict_Merge(mp, other, 1). */ |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
22956
diff
changeset
|
87 PyAPI_FUNC(int) PyDict_Update(PyObject *mp, PyObject *other); |
|
12126
e6214ad2a60c
Add PyDict_Copy() function to C API for dicts. It returns a new
Jeremy Hylton <jeremy@alum.mit.edu>
parents:
9586
diff
changeset
|
88 |
|
21348
12310d643d8d
SF bug #491415 PyDict_UpdateFromSeq2() unused
Tim Peters <tim.peters@gmail.com>
parents:
19150
diff
changeset
|
89 /* PyDict_Merge updates/merges from a mapping object (an object that |
|
12310d643d8d
SF bug #491415 PyDict_UpdateFromSeq2() unused
Tim Peters <tim.peters@gmail.com>
parents:
19150
diff
changeset
|
90 supports PyMapping_Keys() and PyObject_GetItem()). If override is true, |
|
12310d643d8d
SF bug #491415 PyDict_UpdateFromSeq2() unused
Tim Peters <tim.peters@gmail.com>
parents:
19150
diff
changeset
|
91 the last occurrence of a key wins, else the first. The Python |
|
12310d643d8d
SF bug #491415 PyDict_UpdateFromSeq2() unused
Tim Peters <tim.peters@gmail.com>
parents:
19150
diff
changeset
|
92 dict.update(other) is equivalent to PyDict_Merge(dict, other, 1). |
|
12310d643d8d
SF bug #491415 PyDict_UpdateFromSeq2() unused
Tim Peters <tim.peters@gmail.com>
parents:
19150
diff
changeset
|
93 */ |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
22956
diff
changeset
|
94 PyAPI_FUNC(int) PyDict_Merge(PyObject *mp, |
|
61467
f197407bdba2
Recorded merge of revisions 81032 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
52291
diff
changeset
|
95 PyObject *other, |
|
f197407bdba2
Recorded merge of revisions 81032 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
52291
diff
changeset
|
96 int override); |
|
21348
12310d643d8d
SF bug #491415 PyDict_UpdateFromSeq2() unused
Tim Peters <tim.peters@gmail.com>
parents:
19150
diff
changeset
|
97 |
|
12310d643d8d
SF bug #491415 PyDict_UpdateFromSeq2() unused
Tim Peters <tim.peters@gmail.com>
parents:
19150
diff
changeset
|
98 /* PyDict_MergeFromSeq2 updates/merges from an iterable object producing |
|
12310d643d8d
SF bug #491415 PyDict_UpdateFromSeq2() unused
Tim Peters <tim.peters@gmail.com>
parents:
19150
diff
changeset
|
99 iterable objects of length 2. If override is true, the last occurrence |
|
12310d643d8d
SF bug #491415 PyDict_UpdateFromSeq2() unused
Tim Peters <tim.peters@gmail.com>
parents:
19150
diff
changeset
|
100 of a key wins, else the first. The Python dict constructor dict(seq2) |
|
12310d643d8d
SF bug #491415 PyDict_UpdateFromSeq2() unused
Tim Peters <tim.peters@gmail.com>
parents:
19150
diff
changeset
|
101 is equivalent to dict={}; PyDict_MergeFromSeq(dict, seq2, 1). |
|
12310d643d8d
SF bug #491415 PyDict_UpdateFromSeq2() unused
Tim Peters <tim.peters@gmail.com>
parents:
19150
diff
changeset
|
102 */ |
|
24752
c1eb668525e1
Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents:
22956
diff
changeset
|
103 PyAPI_FUNC(int) PyDict_MergeFromSeq2(PyObject *d, |
|
61467
f197407bdba2
Recorded merge of revisions 81032 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
52291
diff
changeset
|
104 PyObject *seq2, |
|
f197407bdba2
Recorded merge of revisions 81032 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
52291
diff
changeset
|
105 int override); |
|
5508
3643f19d5ca1
Subsumed mappingobject.h in dictobject.h.
Guido van Rossum <guido@python.org>
parents:
4503
diff
changeset
|
106 |
|
26599
ecea8410178e
Constify char* API. Fixes #651363. 2.2 candidate.
Martin v. Löwis <martin@v.loewis.de>
parents:
24752
diff
changeset
|
107 PyAPI_FUNC(PyObject *) PyDict_GetItemString(PyObject *dp, const char *key); |
|
75959
c67f3681e032
Issue #14383: Add _PyDict_GetItemId() and _PyDict_SetItemId() functions
Victor Stinner <victor.stinner@gmail.com>
parents:
73551
diff
changeset
|
108 PyAPI_FUNC(PyObject *) _PyDict_GetItemId(PyObject *dp, struct _Py_Identifier *key); |
|
26599
ecea8410178e
Constify char* API. Fixes #651363. 2.2 candidate.
Martin v. Löwis <martin@v.loewis.de>
parents:
24752
diff
changeset
|
109 PyAPI_FUNC(int) PyDict_SetItemString(PyObject *dp, const char *key, PyObject *item); |
|
75959
c67f3681e032
Issue #14383: Add _PyDict_GetItemId() and _PyDict_SetItemId() functions
Victor Stinner <victor.stinner@gmail.com>
parents:
73551
diff
changeset
|
110 PyAPI_FUNC(int) _PyDict_SetItemId(PyObject *dp, struct _Py_Identifier *key, PyObject *item); |
|
26599
ecea8410178e
Constify char* API. Fixes #651363. 2.2 candidate.
Martin v. Löwis <martin@v.loewis.de>
parents:
24752
diff
changeset
|
111 PyAPI_FUNC(int) PyDict_DelItemString(PyObject *dp, const char *key); |
| 6 | 112 |
|
76485
6e5855854a2e
Implement PEP 412: Key-sharing dictionaries (closes #13903)
Benjamin Peterson <benjamin@python.org>
parents:
76303
diff
changeset
|
113 #ifndef Py_LIMITED_API |
|
87004
bf9c77bac36d
Issue #19512, #19526: Exclude the new _PyDict_DelItemId() function from the
Victor Stinner <victor.stinner@gmail.com>
parents:
86968
diff
changeset
|
114 PyAPI_FUNC(int) _PyDict_DelItemId(PyObject *mp, struct _Py_Identifier *key); |
|
bf9c77bac36d
Issue #19512, #19526: Exclude the new _PyDict_DelItemId() function from the
Victor Stinner <victor.stinner@gmail.com>
parents:
86968
diff
changeset
|
115 PyAPI_FUNC(void) _PyDict_DebugMallocStats(FILE *out); |
|
bf9c77bac36d
Issue #19512, #19526: Exclude the new _PyDict_DelItemId() function from the
Victor Stinner <victor.stinner@gmail.com>
parents:
86968
diff
changeset
|
116 |
|
76485
6e5855854a2e
Implement PEP 412: Key-sharing dictionaries (closes #13903)
Benjamin Peterson <benjamin@python.org>
parents:
76303
diff
changeset
|
117 int _PyObjectDict_SetItem(PyTypeObject *tp, PyObject **dictptr, PyObject *name, PyObject *value); |
|
6e5855854a2e
Implement PEP 412: Key-sharing dictionaries (closes #13903)
Benjamin Peterson <benjamin@python.org>
parents:
76303
diff
changeset
|
118 PyObject *_PyDict_LoadGlobal(PyDictObject *, PyDictObject *, PyObject *); |
|
6e5855854a2e
Implement PEP 412: Key-sharing dictionaries (closes #13903)
Benjamin Peterson <benjamin@python.org>
parents:
76303
diff
changeset
|
119 #endif |
|
6e5855854a2e
Implement PEP 412: Key-sharing dictionaries (closes #13903)
Benjamin Peterson <benjamin@python.org>
parents:
76303
diff
changeset
|
120 |
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
121 #ifdef __cplusplus |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
122 } |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
123 #endif |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1288
diff
changeset
|
124 #endif /* !Py_DICTOBJECT_H */ |
