https://github.com/python/cpython/commit/02f55f30a3d80733bd336ea15e59e88139528b9c commit: 02f55f30a3d80733bd336ea15e59e88139528b9c branch: 3.15 author: Miss Islington (bot) <[email protected]> committer: hugovk <[email protected]> date: 2026-09-06T22:15:38+01:00 summary:
[3.15] Add separate docstring for frozendict (gh-156986) (#157018) no-issue: Add separate docstring for frozendict (gh-156986) (cherry picked from commit 7cd63cddade4c3e1de17c3443695afe1f41d8495) Co-authored-by: James Morris <[email protected]> files: M Objects/dictobject.c diff --git a/Objects/dictobject.c b/Objects/dictobject.c index afbd9a96c08d81c..53dc90be4c91e22 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -8503,6 +8503,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) @@ -8518,7 +8529,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]
