)]}'
{
  "commit": "0d708cb9c9d5291c1c988ef90a1b77307ed5315c",
  "tree": "14b51cf55f32168d1865079b0a5cd7589cdd7ce4",
  "parents": [
    "2b613e5ba1ada5a44f88a90528af834bf9f770a7"
  ],
  "author": {
    "name": "Ivan Levkivskyi",
    "email": "levkivskyi@gmail.com",
    "time": "Fri Aug 04 00:17:42 2023 +0100"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Fri Aug 04 00:17:42 2023 +0100"
  },
  "message": "New type inference: complete transitive closure (#15754)\n\nThis is a first follow-up for #15287 (I like how my PR titles sound like\r\nresearch paper titles, LOL)\r\n\r\nThis PR completes the new type inference foundations by switching to a\r\ncomplete and well founded algorithm [1] for transitive closure (that\r\nreplaces more ad hoc initial algorithm that covered 80% of cases and was\r\ngood for experimenting with new inference scheme). In particular the\r\nalgorithm in this PR covers two important edge cases (see tests). Some\r\ncomments:\r\n* I don\u0027t intend to switch the default for `--new-type-inference`, I\r\njust want to see the effect of the switch on `mypy_primer`, I will\r\nswitch back to false before merging\r\n* This flag is still not ready to be publicly announced, I am going to\r\nmake another 2-3 PRs from the list in #15287 before making this public.\r\n* I am not adding yet the unit tests as discussed in previous PR. This\r\nPR is already quite big, and the next one (support for upper bounds and\r\nvalues) should be much smaller. I am going to add unit tests only for\r\n`transitive_closure()` which is the core of new logic.\r\n* While working on this I fixed couple bugs exposed in `TypeVarTuple`\r\nsupport: one is rare technical corner case, another one is serious,\r\ntemplate and actual where swapped during constraint inference,\r\neffectively causing outer/return context to be completely ignored for\r\ninstances.\r\n* It is better to review the PR with \"ignore whitespace\" option turned\r\non (there is big chunk in solve.py that is just change of indentation).\r\n* There is one questionable design choice I am making in this PR, I am\r\nadding `extra_tvars` as an attribute of `Constraint` class, while it\r\nlogically should not be attributed to any individual constraint, but\r\nrather to the full list of constrains. However, doing this properly\r\nwould require changing the return type of `infer_constrains()` and all\r\nrelated functions, which would be a really big refactoring.\r\n\r\n[1] Definition 7.1 in https://inria.hal.science/inria-00073205/document\r\n\r\n---------\r\n\r\nCo-authored-by: pre-commit-ci[bot] \u003c66853113+pre-commit-ci[bot]@users.noreply.github.com\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "0c27da8b5ac86f14eaf73a27770bd67df2b9650b",
      "old_mode": 33188,
      "old_path": "mypy/checker.py",
      "new_id": "b786155079e577151043bfd17469d4dbc9888715",
      "new_mode": 33188,
      "new_path": "mypy/checker.py"
    },
    {
      "type": "modify",
      "old_id": "114cde8327e00244732a8a79519d5926b7a2066c",
      "old_mode": 33188,
      "old_path": "mypy/checkexpr.py",
      "new_id": "9e46d9ee39cb8136ad3785b5633ede6c345ccdbc",
      "new_mode": 33188,
      "new_path": "mypy/checkexpr.py"
    },
    {
      "type": "modify",
      "old_id": "f9124630a706e5ba8e7e75649811bc7f2d92ec94",
      "old_mode": 33188,
      "old_path": "mypy/constraints.py",
      "new_id": "299c6292a2594f7f22ecfce0e31d96e5f3e1eb79",
      "new_mode": 33188,
      "new_path": "mypy/constraints.py"
    },
    {
      "type": "modify",
      "old_id": "83d9bf4c8725d29504e1281282bd891ee64673ab",
      "old_mode": 33188,
      "old_path": "mypy/expandtype.py",
      "new_id": "b599b49e4c12afed3eb0dc8d4410c5d076ac04ee",
      "new_mode": 33188,
      "new_path": "mypy/expandtype.py"
    },
    {
      "type": "modify",
      "old_id": "66ca4169e2ff53505f176bc02f109714a338ba2c",
      "old_mode": 33188,
      "old_path": "mypy/infer.py",
      "new_id": "f34087910e4bc6a1b0d560713cfc62337c22be0a",
      "new_mode": 33188,
      "new_path": "mypy/infer.py"
    },
    {
      "type": "modify",
      "old_id": "6693d66f3479d61d21e64606adf8e26f6c877c2e",
      "old_mode": 33188,
      "old_path": "mypy/solve.py",
      "new_id": "02df90aff1e18f41741b17986c8708394f5fb6bc",
      "new_mode": 33188,
      "new_path": "mypy/solve.py"
    },
    {
      "type": "modify",
      "old_id": "a6dc071f92b00e7cfaf1d8accdeee14bb0401fcf",
      "old_mode": 33188,
      "old_path": "mypy/subtypes.py",
      "new_id": "5712d7375e50fc926a02066061f173723493c123",
      "new_mode": 33188,
      "new_path": "mypy/subtypes.py"
    },
    {
      "type": "modify",
      "old_id": "b46f313271501cb1bd534dc2026c345731c86d15",
      "old_mode": 33188,
      "old_path": "mypy/test/testconstraints.py",
      "new_id": "f40996145cba7839afc23479d4929520c2d0ec27",
      "new_mode": 33188,
      "new_path": "mypy/test/testconstraints.py"
    },
    {
      "type": "modify",
      "old_id": "d6c585ef4aaac0b843ad109dac2ae5ebe23b75f2",
      "old_mode": 33188,
      "old_path": "mypy/test/testsolve.py",
      "new_id": "5d67203dbbf54f99548ee653db8161248e2ff7d1",
      "new_mode": 33188,
      "new_path": "mypy/test/testsolve.py"
    },
    {
      "type": "modify",
      "old_id": "519d3de995f572838010db36fb0e834f1f5f6167",
      "old_mode": 33188,
      "old_path": "mypy/typeops.py",
      "new_id": "65ab4340403c608998ff0bab3c649fd74b3a3a6e",
      "new_mode": 33188,
      "new_path": "mypy/typeops.py"
    },
    {
      "type": "modify",
      "old_id": "7413e6407d4fd8f7c75c223827992c3fa85829b3",
      "old_mode": 33188,
      "old_path": "mypy_self_check.ini",
      "new_id": "fcdbe641d6d6f2c70aeac4cc304f27a60bbd2336",
      "new_mode": 33188,
      "new_path": "mypy_self_check.ini"
    },
    {
      "type": "modify",
      "old_id": "34588bfceb3d8d49b64e9f799d838e3a08126dca",
      "old_mode": 33188,
      "old_path": "test-data/unit/check-generics.test",
      "new_id": "5c510a11b97087de257a9ba688b9baa7701c32ba",
      "new_mode": 33188,
      "new_path": "test-data/unit/check-generics.test"
    },
    {
      "type": "modify",
      "old_id": "89e5aea210b4daea924e035861b96f781b59d92e",
      "old_mode": 33188,
      "old_path": "test-data/unit/check-overloading.test",
      "new_id": "50acd7d77c8cd37a3d31e9c5f34272b538bc1aac",
      "new_mode": 33188,
      "new_path": "test-data/unit/check-overloading.test"
    }
  ]
}
