https://github.com/python/cpython/commit/7cd63cddade4c3e1de17c3443695afe1f41d8495
commit: 7cd63cddade4c3e1de17c3443695afe1f41d8495
branch: main
author: James Morris <[email protected]>
committer: corona10 <[email protected]>
date: 2026-09-06T10:12:41+09:00
summary:

no-issue: Add separate docstring for frozendict (gh-156986)

files:
M Objects/dictobject.c

diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index 74b6d5d779a064..357e714de9a6c0 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -8571,6 +8571,17 @@ frozendict_copy_impl(PyFrozenDictObject *self)
     return copy;
 }
 
+PyDoc_STRVAR(frozendict_doc,
+"frozendict() -> new empty immutable dictionary\n"
+"frozendict(mapping) -> new immutable dictionary initialized from a mapping\n"
+"    object's (key, value) pairs\n"
+"frozendict(iterable) -> new immutable dictionary initialized as if via:\n"
+"    d = {}\n"
+"    for k, v in iterable:\n"
+"        d[k] = v\n"
+"    d = frozendict(d)\n"
+"frozendict(**kwargs) -> new immutable dictionary initialized with the 
name=value\n"
+"    pairs in the keyword argument list.  For example:  frozendict(one=1, 
two=2)");
 
 PyTypeObject PyFrozenDict_Type = {
     PyVarObject_HEAD_INIT(&PyType_Type, 0)
@@ -8586,7 +8597,7 @@ PyTypeObject PyFrozenDict_Type = {
     .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC
                 | Py_TPFLAGS_BASETYPE
                 | _Py_TPFLAGS_MATCH_SELF | Py_TPFLAGS_MAPPING,
-    .tp_doc = dictionary_doc,
+    .tp_doc = frozendict_doc,
     .tp_traverse = dict_traverse,
     .tp_clear = dict_tp_clear,
     .tp_richcompare = dict_richcompare,

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to