Lines Matching defs:keys
646 /* Sort the keys so that we have a deterministic order on the indexes
1376 // constant keys.
2359 PyObject *keys = NULL;
2369 if (keys == NULL) {
2370 keys = PyList_New(1);
2371 if (keys == NULL) {
2375 PyList_SET_ITEM(keys, 0, mangled);
2378 int res = PyList_Append(keys, mangled);
2389 if (keys != NULL) {
2390 Py_ssize_t default_count = PyList_GET_SIZE(keys);
2391 PyObject *keys_tuple = PyList_AsTuple(keys);
2392 Py_DECREF(keys);
2403 Py_XDECREF(keys);
4556 PyObject *keys, *key;
4558 if (n > 1 && !big && are_all_items_const(e->v.Dict.keys, begin, end)) {
4562 keys = PyTuple_New(n);
4563 if (keys == NULL) {
4567 key = ((expr_ty)asdl_seq_GET(e->v.Dict.keys, i))->v.Constant.value;
4569 PyTuple_SET_ITEM(keys, i - begin, key);
4571 ADDOP_LOAD_CONST_NEW(c, keys);
4579 VISIT(c, expr, (expr_ty)asdl_seq_GET(e->v.Dict.keys, i));
4601 is_unpacking = (expr_ty)asdl_seq_GET(e->v.Dict.keys, i) == NULL;
5031 PyObject *keys, *key;
5039 keys = PyTuple_New(n);
5040 if (keys == NULL) {
5046 PyTuple_SET_ITEM(keys, i - begin, key);
5048 ADDOP_LOAD_CONST_NEW(c, keys);
6628 asdl_expr_seq *keys = p->v.MatchMapping.keys;
6630 Py_ssize_t size = asdl_seq_LEN(keys);
6635 const char * e = "keys (%d) / patterns (%d) length mismatch in mapping pattern";
6651 // If the pattern has any keys in it, perform a length check:
6660 // Collect all of the keys into a tuple for MATCH_KEYS and
6663 // Maintaining a set of Constant_kind kind keys allows us to raise a
6672 expr_ty key = asdl_seq_GET(keys, i);
6674 const char *e = "can't use NULL keys in MatchMapping "
6697 const char *e = "mapping pattern keys may only match literals and attribute lookups";
6706 // all keys have been checked; there are no duplicates
6711 // There's now a tuple of keys and a tuple of values on top of the subject:
6727 // the tuple of keys and the subject:
6731 // seem a bit inefficient, but keys is rarely big enough to actually impact
6736 ADDOP_I(c, BUILD_MAP, 0); // [subject, keys, empty]
6737 ADDOP_I(c, SWAP, 3); // [empty, keys, subject]
6738 ADDOP_I(c, DICT_UPDATE, 2); // [copy, keys]
6739 ADDOP_I(c, UNPACK_SEQUENCE, size); // [copy, keys...]
6741 ADDOP_I(c, COPY, 1 + size--); // [copy, keys..., copy]
6742 ADDOP_I(c, SWAP, 2); // [copy, keys..., copy, key]
6743 ADDOP(c, DELETE_SUBSCR); // [copy, keys...]
6748 ADDOP(c, POP_TOP); // Tuple of keys.
7852 /* The keys of the dictionary can be tuples wrapping a constant.