Skip to content

Commit 02f55f3

Browse files
miss-islingtonJ-M0
andauthored
[3.15] Add separate docstring for frozendict (gh-156986) (#157018)
no-issue: Add separate docstring for frozendict (gh-156986) (cherry picked from commit 7cd63cd) Co-authored-by: James Morris <6653392+J-M0@users.noreply.github.com>
1 parent 5e19ff3 commit 02f55f3

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

Objects/dictobject.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8503,6 +8503,17 @@ frozendict_copy_impl(PyFrozenDictObject *self)
85038503
return copy;
85048504
}
85058505

8506+
PyDoc_STRVAR(frozendict_doc,
8507+
"frozendict() -> new empty immutable dictionary\n"
8508+
"frozendict(mapping) -> new immutable dictionary initialized from a mapping\n"
8509+
" object's (key, value) pairs\n"
8510+
"frozendict(iterable) -> new immutable dictionary initialized as if via:\n"
8511+
" d = {}\n"
8512+
" for k, v in iterable:\n"
8513+
" d[k] = v\n"
8514+
" d = frozendict(d)\n"
8515+
"frozendict(**kwargs) -> new immutable dictionary initialized with the name=value\n"
8516+
" pairs in the keyword argument list. For example: frozendict(one=1, two=2)");
85068517

85078518
PyTypeObject PyFrozenDict_Type = {
85088519
PyVarObject_HEAD_INIT(&PyType_Type, 0)
@@ -8518,7 +8529,7 @@ PyTypeObject PyFrozenDict_Type = {
85188529
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC
85198530
| Py_TPFLAGS_BASETYPE
85208531
| _Py_TPFLAGS_MATCH_SELF | Py_TPFLAGS_MAPPING,
8521-
.tp_doc = dictionary_doc,
8532+
.tp_doc = frozendict_doc,
85228533
.tp_traverse = dict_traverse,
85238534
.tp_clear = dict_tp_clear,
85248535
.tp_richcompare = dict_richcompare,

0 commit comments

Comments
 (0)