#include "pycore_critical_section.h"
#include "pycore_modsupport.h"
PyDoc_STRVAR(dict_fromkeys__doc__,
"fromkeys($type, iterable, value=None, /)\n"
"--\n"
"\n"
"Create a new dictionary with keys from iterable and values set to value.");
#define DICT_FROMKEYS_METHODDEF …
static PyObject *
dict_fromkeys_impl(PyTypeObject *type, PyObject *iterable, PyObject *value);
static PyObject *
dict_fromkeys(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs)
{ … }
PyDoc_STRVAR(dict_copy__doc__,
"copy($self, /)\n"
"--\n"
"\n"
"Return a shallow copy of the dict.");
#define DICT_COPY_METHODDEF …
static PyObject *
dict_copy_impl(PyDictObject *self);
static PyObject *
dict_copy(PyDictObject *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(dict___contains____doc__,
"__contains__($self, key, /)\n"
"--\n"
"\n"
"True if the dictionary has the specified key, else False.");
#define DICT___CONTAINS___METHODDEF …
PyDoc_STRVAR(dict_get__doc__,
"get($self, key, default=None, /)\n"
"--\n"
"\n"
"Return the value for key if key is in the dictionary, else default.");
#define DICT_GET_METHODDEF …
static PyObject *
dict_get_impl(PyDictObject *self, PyObject *key, PyObject *default_value);
static PyObject *
dict_get(PyDictObject *self, PyObject *const *args, Py_ssize_t nargs)
{ … }
PyDoc_STRVAR(dict_setdefault__doc__,
"setdefault($self, key, default=None, /)\n"
"--\n"
"\n"
"Insert key with a value of default if key is not in the dictionary.\n"
"\n"
"Return the value for key if key is in the dictionary, else default.");
#define DICT_SETDEFAULT_METHODDEF …
static PyObject *
dict_setdefault_impl(PyDictObject *self, PyObject *key,
PyObject *default_value);
static PyObject *
dict_setdefault(PyDictObject *self, PyObject *const *args, Py_ssize_t nargs)
{ … }
PyDoc_STRVAR(dict_clear__doc__,
"clear($self, /)\n"
"--\n"
"\n"
"Remove all items from the dict.");
#define DICT_CLEAR_METHODDEF …
static PyObject *
dict_clear_impl(PyDictObject *self);
static PyObject *
dict_clear(PyDictObject *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(dict_pop__doc__,
"pop($self, key, default=<unrepresentable>, /)\n"
"--\n"
"\n"
"D.pop(k[,d]) -> v, remove specified key and return the corresponding value.\n"
"\n"
"If the key is not found, return the default if given; otherwise,\n"
"raise a KeyError.");
#define DICT_POP_METHODDEF …
static PyObject *
dict_pop_impl(PyDictObject *self, PyObject *key, PyObject *default_value);
static PyObject *
dict_pop(PyDictObject *self, PyObject *const *args, Py_ssize_t nargs)
{ … }
PyDoc_STRVAR(dict_popitem__doc__,
"popitem($self, /)\n"
"--\n"
"\n"
"Remove and return a (key, value) pair as a 2-tuple.\n"
"\n"
"Pairs are returned in LIFO (last-in, first-out) order.\n"
"Raises KeyError if the dict is empty.");
#define DICT_POPITEM_METHODDEF …
static PyObject *
dict_popitem_impl(PyDictObject *self);
static PyObject *
dict_popitem(PyDictObject *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(dict___sizeof____doc__,
"__sizeof__($self, /)\n"
"--\n"
"\n"
"Return the size of the dict in memory, in bytes.");
#define DICT___SIZEOF___METHODDEF …
static PyObject *
dict___sizeof___impl(PyDictObject *self);
static PyObject *
dict___sizeof__(PyDictObject *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(dict___reversed____doc__,
"__reversed__($self, /)\n"
"--\n"
"\n"
"Return a reverse iterator over the dict keys.");
#define DICT___REVERSED___METHODDEF …
static PyObject *
dict___reversed___impl(PyDictObject *self);
static PyObject *
dict___reversed__(PyDictObject *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(dict_keys__doc__,
"keys($self, /)\n"
"--\n"
"\n"
"Return a set-like object providing a view on the dict\'s keys.");
#define DICT_KEYS_METHODDEF …
static PyObject *
dict_keys_impl(PyDictObject *self);
static PyObject *
dict_keys(PyDictObject *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(dict_items__doc__,
"items($self, /)\n"
"--\n"
"\n"
"Return a set-like object providing a view on the dict\'s items.");
#define DICT_ITEMS_METHODDEF …
static PyObject *
dict_items_impl(PyDictObject *self);
static PyObject *
dict_items(PyDictObject *self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(dict_values__doc__,
"values($self, /)\n"
"--\n"
"\n"
"Return an object providing a view on the dict\'s values.");
#define DICT_VALUES_METHODDEF …
static PyObject *
dict_values_impl(PyDictObject *self);
static PyObject *
dict_values(PyDictObject *self, PyObject *Py_UNUSED(ignored))
{ … }