Lines Matching defs:key
632 each key.
1319 // Merge const *o* recursively and return constant key object.
1323 // None and Ellipsis are singleton, and key is the singleton.
1324 // No need to merge object and key.
1330 PyObject *key = _PyCode_ConstantKey(o);
1331 if (key == NULL) {
1336 PyObject *t = PyDict_SetDefault(c->c_const_cache, key, key);
1337 if (t != key) {
1340 Py_DECREF(key);
1353 Py_DECREF(key);
1375 // *key* is tuple. And its first item is frozenset of
1378 assert(PyTuple_CheckExact(key));
1379 assert(PyTuple_GET_SIZE(key) == 2);
1383 return key;
1387 Py_DECREF(key);
1397 Py_DECREF(key);
1414 // key tuple. Caller should get merged frozenset from the key tuple.
1418 Py_DECREF(key);
1421 assert(PyTuple_GET_ITEM(key, 1) == o);
1423 PyTuple_SET_ITEM(key, 1, new);
1426 return key;
1432 PyObject *key = merge_consts_recursive(c, o);
1433 if (key == NULL) {
1437 Py_ssize_t arg = compiler_add_o(c->u->u_consts, key);
1438 Py_DECREF(key);
1716 int scope_type, void *key, int lineno)
1731 u->u_ste = PySymtable_Lookup(c->c_st, key);
4545 expr_ty key = (expr_ty)asdl_seq_GET(seq, i);
4546 if (key == NULL || key->kind != Constant_kind)
4556 PyObject *keys, *key;
4567 key = ((expr_ty)asdl_seq_GET(e->v.Dict.keys, i))->v.Constant.value;
4568 Py_INCREF(key);
4569 PyTuple_SET_ITEM(keys, i - begin, key);
4913 keyword_ty key = ((keyword_ty)asdl_seq_GET(keywords, i));
4914 if (key->arg == NULL) {
4917 if (forbidden_name(c, key->arg, Store)) {
4922 if (other->arg && !PyUnicode_Compare(key->arg, other->arg)) {
4924 compiler_error(c, "keyword argument repeated: %U", key->arg);
5031 PyObject *keys, *key;
5044 key = ((keyword_ty) asdl_seq_GET(keywords, i))->arg;
5045 Py_INCREF(key);
5046 PyTuple_SET_ITEM(keys, i - begin, key);
5589 e->v.DictComp.key, e->v.DictComp.value);
6672 expr_ty key = asdl_seq_GET(keys, i);
6673 if (key == NULL) {
6681 if (key->kind == Constant_kind) {
6682 int in_seen = PySet_Contains(seen, key->v.Constant.value);
6687 const char *e = "mapping pattern checks duplicate key (%R)";
6688 compiler_error(c, e, key->v.Constant.value);
6691 if (PySet_Add(seen, key->v.Constant.value)) {
6696 else if (key->kind != Attribute_kind) {
6701 if (!compiler_visit_expr(c, key)) {
6734 // for key in TOS:
6735 // del rest[key]
6742 ADDOP_I(c, SWAP, 2); // [copy, keys..., copy, key]
7904 PyObject *key = _PyCode_ConstantKey(*obj);
7905 if (key == NULL) {
7910 PyObject *t = PyDict_SetDefault(c->c_const_cache, key, key);
7911 Py_DECREF(key);
7915 if (t == key) { // obj is new constant.