Skip to content

Commit ecf771c

Browse files
author
Marco Sulla
committed
added type hinting support for C extension
1 parent aec4478 commit ecf771c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

frozendict/src/3_10/frozendictobject.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2132,7 +2132,8 @@ static PyMethodDef frozen_mapp_methods[] = {
21322132
{"copy", (PyCFunction)frozendict_copy, METH_NOARGS,
21332133
copy__doc__},
21342134
DICT___REVERSED___METHODDEF
2135-
{"__reduce__", (PyCFunction)(void(*)(void))frozendict_reduce, METH_NOARGS,
2135+
{"__class_getitem__", Py_GenericAlias, METH_O|METH_CLASS, "See PEP 585"},
2136+
{"__reduce__", (PyCFunction)(void(*)(void))frozendict_reduce, METH_NOARGS,
21362137
""},
21372138
{NULL, NULL} /* sentinel */
21382139
};

frozendict/src/3_9/frozendictobject.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2128,7 +2128,8 @@ static PyMethodDef frozen_mapp_methods[] = {
21282128
{"copy", (PyCFunction)frozendict_copy, METH_NOARGS,
21292129
copy__doc__},
21302130
DICT___REVERSED___METHODDEF
2131-
{"__reduce__", (PyCFunction)(void(*)(void))frozendict_reduce, METH_NOARGS,
2131+
{"__class_getitem__", Py_GenericAlias, METH_O|METH_CLASS, "See PEP 585"},
2132+
{"__reduce__", (PyCFunction)(void(*)(void))frozendict_reduce, METH_NOARGS,
21322133
""},
21332134
{NULL, NULL} /* sentinel */
21342135
};
@@ -2496,7 +2497,7 @@ PyTypeObject PyCoold_Type = {
24962497
0, /* tp_getattr */
24972498
0, /* tp_setattr */
24982499
0, /* tp_as_async */
2499-
(reprfunc)frozendict_repr, /* tp_repr */
2500+
(reprfunc)frozendict_repr, /* tp_repr */
25002501
0, /* tp_as_number */
25012502
&dict_as_sequence, /* tp_as_sequence */
25022503
&frozendict_as_mapping, /* tp_as_mapping */

0 commit comments

Comments
 (0)