mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Rename "dictionary" (type and constructor) to "dict".
This commit is contained in:
parent
7ad2d1eb8e
commit
a427a2b8d0
10 changed files with 66 additions and 63 deletions
|
@ -1784,7 +1784,7 @@ dict_init(PyObject *self, PyObject *args, PyObject *kwds)
|
|||
static char *kwlist[] = {"items", 0};
|
||||
int result = 0;
|
||||
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O:dictionary",
|
||||
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O:dict",
|
||||
kwlist, &arg))
|
||||
result = -1;
|
||||
|
||||
|
@ -1804,10 +1804,10 @@ dict_iter(dictobject *dict)
|
|||
}
|
||||
|
||||
static char dictionary_doc[] =
|
||||
"dictionary() -> new empty dictionary.\n"
|
||||
"dictionary(mapping) -> new dict initialized from a mapping object's\n"
|
||||
"dict() -> new empty dictionary.\n"
|
||||
"dict(mapping) -> new dictionary initialized from a mapping object's\n"
|
||||
" (key, value) pairs.\n"
|
||||
"dictionary(seq) -> new dict initialized as if via:\n"
|
||||
"dict(seq) -> new dictionary initialized as if via:\n"
|
||||
" d = {}\n"
|
||||
" for k, v in seq:\n"
|
||||
" d[k] = v";
|
||||
|
@ -1815,7 +1815,7 @@ static char dictionary_doc[] =
|
|||
PyTypeObject PyDict_Type = {
|
||||
PyObject_HEAD_INIT(&PyType_Type)
|
||||
0,
|
||||
"dictionary",
|
||||
"dict",
|
||||
sizeof(dictobject),
|
||||
0,
|
||||
(destructor)dict_dealloc, /* tp_dealloc */
|
||||
|
|
|
@ -2484,7 +2484,7 @@ tp_new_wrapper(PyObject *self, PyObject *args, PyObject *kwds)
|
|||
}
|
||||
|
||||
/* Check that the use doesn't do something silly and unsafe like
|
||||
object.__new__(dictionary). To do this, we check that the
|
||||
object.__new__(dict). To do this, we check that the
|
||||
most derived base that's not a heap type is this type. */
|
||||
staticbase = subtype;
|
||||
while (staticbase && (staticbase->tp_flags & Py_TPFLAGS_HEAPTYPE))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue