)]}'
{
  "commit": "068e8b74031deb1c2411467a3bc735914e7d51dd",
  "tree": "b224a0290f2aad6173c36410d52e28d48c783ce9",
  "parents": [
    "f658f8c5144eddc05dee199182eaef7c76ff85ab"
  ],
  "author": {
    "name": "Jahongir Qurbonov",
    "email": "109198731+Jahongir-Qurbonov@users.noreply.github.com",
    "time": "Thu Nov 19 20:07:18 2026 +0500"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Thu Nov 19 15:07:18 2026 +0000"
  },
  "message": "[mypyc] Add primitives for int and bytes containment in bytes (#22409)\n\nAdd primitives for `x in b` / `x not in b` where `b` is `bytes` and `x`\nis `int` or `bytes`.\n\nPreviously these used `PySequence_Contains`. For a `bytes` item that is\nparticularly slow, since `bytes.__contains__` first tries to convert the\nitem to an integer, which raises and clears a `TypeError`, and then\nacquires a buffer.\n\n- `int in bytes`: for an exact `bytes` object, a range check followed by\n`memchr`. Out-of-range values raise the same `ValueError` as CPython.\n- `bytes in bytes`: if both are exact `bytes` objects and the needle is\nat most 32 bytes long, search directly using `memchr` + `memcmp`. Longer\nneedles fall back to the generic implementation, which has better\nworst-case behavior.\n- Subclasses (which may override `__contains__`) use the generic path.\n\nTests compare the results against the generic implementation (through\n`Any`) for all byte values, out-of-range and big ints, and all\nsubstrings (plus near-miss variants) of several haystacks.\n\nMicro-benchmark (compiled code, before -\u003e after, Python 3.13):\n- `int in bytes` (3.2M checks): 0.025s -\u003e 0.0086s\n- 1-byte `bytes in bytes` (3.2M checks): 0.49s -\u003e 0.026s\n- multi-byte `bytes in bytes` (3.2M checks): 0.49s -\u003e 0.039s\n\nPart of mypyc/mypyc#644.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "6e9c27427e1e97c3c5d3bce1b0679d47dae82e0d",
      "old_mode": 33188,
      "old_path": "mypyc/doc/bytes_operations.rst",
      "new_id": "6a0d659fac07eb97af0ee4ea3276a02e8556ef84",
      "new_mode": 33188,
      "new_path": "mypyc/doc/bytes_operations.rst"
    },
    {
      "type": "modify",
      "old_id": "ae9e61b1cffab2d828aa242030faf14c6941d243",
      "old_mode": 33188,
      "old_path": "mypyc/lib-rt/bytes_extra_ops.c",
      "new_id": "bf6be2a31b6a2f7eb46a8c7706c3008d2167ce69",
      "new_mode": 33188,
      "new_path": "mypyc/lib-rt/bytes_extra_ops.c"
    },
    {
      "type": "modify",
      "old_id": "0f2917764ba068934ed023d9f5a1936c882d7376",
      "old_mode": 33188,
      "old_path": "mypyc/lib-rt/bytes_extra_ops.h",
      "new_id": "e5c8798bf49db52badc9acd3e3dff7049cd07053",
      "new_mode": 33188,
      "new_path": "mypyc/lib-rt/bytes_extra_ops.h"
    },
    {
      "type": "modify",
      "old_id": "9efeb108afb6464fcc40e7c3438ade462b5dd80f",
      "old_mode": 33188,
      "old_path": "mypyc/primitives/bytes_ops.py",
      "new_id": "4f14fb6f5a631e95e3a18cc23820298168d51820",
      "new_mode": 33188,
      "new_path": "mypyc/primitives/bytes_ops.py"
    },
    {
      "type": "modify",
      "old_id": "b0808b60bdd2f60b47c6ad5cf374943b0c953c8a",
      "old_mode": 33188,
      "old_path": "mypyc/test-data/fixtures/ir.py",
      "new_id": "86d5baa1a983aa1b7c6def51d8c7033a361b25df",
      "new_mode": 33188,
      "new_path": "mypyc/test-data/fixtures/ir.py"
    },
    {
      "type": "modify",
      "old_id": "9dea9d9dd6470fdbf1f784a279ecf8906637accf",
      "old_mode": 33188,
      "old_path": "mypyc/test-data/irbuild-bytes.test",
      "new_id": "a77378b6b192b32f1674d818d4c40db959aff8a7",
      "new_mode": 33188,
      "new_path": "mypyc/test-data/irbuild-bytes.test"
    },
    {
      "type": "modify",
      "old_id": "a847fa5f7ecbe02318721bf0148ef2dc2cc731e2",
      "old_mode": 33188,
      "old_path": "mypyc/test-data/run-bytes.test",
      "new_id": "b7f11e894ffcc63502dea728f6da7a65e5291498",
      "new_mode": 33188,
      "new_path": "mypyc/test-data/run-bytes.test"
    }
  ]
}
