Skip to content

Commit 7cd63cd

Browse files
authored
no-issue: Add separate docstring for frozendict (gh-156986)
1 parent 7a91841 commit 7cd63cd

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
@@ -8571,6 +8571,17 @@ frozendict_copy_impl(PyFrozenDictObject *self)
85718571
return copy;
85728572
}
85738573

8574+
PyDoc_STRVAR(frozendict_doc,
8575+
"frozendict() -> new empty immutable dictionary\n"
8576+
"frozendict(mapping) -> new immutable dictionary initialized from a mapping\n"
8577+
" object's (key, value) pairs\n"
8578+
"frozendict(iterable) -> new immutable dictionary initialized as if via:\n"
8579+
" d = {}\n"
8580+
" for k, v in iterable:\n"
8581+
" d[k] = v\n"
8582+
" d = frozendict(d)\n"
8583+
"frozendict(**kwargs) -> new immutable dictionary initialized with the name=value\n"
8584+
" pairs in the keyword argument list. For example: frozendict(one=1, two=2)");
85748585

85758586
PyTypeObject PyFrozenDict_Type = {
85768587
PyVarObject_HEAD_INIT(&PyType_Type, 0)
@@ -8586,7 +8597,7 @@ PyTypeObject PyFrozenDict_Type = {
85868597
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC
85878598
| Py_TPFLAGS_BASETYPE
85888599
| _Py_TPFLAGS_MATCH_SELF | Py_TPFLAGS_MAPPING,
8589-
.tp_doc = dictionary_doc,
8600+
.tp_doc = frozendict_doc,
85908601
.tp_traverse = dict_traverse,
85918602
.tp_clear = dict_tp_clear,
85928603
.tp_richcompare = dict_richcompare,

0 commit comments

Comments
 (0)