-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Untangle most of the big import cycle (#7397)
Currently mypy has a 47 module import cycle, which is not great. This untangles things, leaving the following cycles: * Size 2: mypy.build, mypy.semanal_main * Size 2: mypy.plugin, mypy.interpreted_plugin * Size 4: mypy.checker, mypy.checkexpr, mypy.checkmember, mypy.checkstrformat. The type checker itself. This could be untangled by having the sub-checkers operate on an interface of the checker, like the semantic analyzer does. * Size 5: mypy.nodes, mypy.types, mypy.type_visitor, mypy.visitors, mypy.strconv. This can't really be untangled. * Size 14: mypy.messages, mypy.expandtype, mypy.erasetype, mypy.typevars, mypy.maptype, mypy.typeops, mypy.sametypes, mypy.subtypes, mypy.constraints, mypy.applytype, mypy.join, mypy.meet, mypy.solve, mypy.infer. The "typeops tangle". Untangling a little further is probably possible but will require some thought and actual logic changes to code. Messages can definitely be removed. The untangling done here is pretty simple and consists of two main parts: * Remove `mypy.types`'s dependency on the type ops tangle by moving all of its functions that depend on it into `mypy.typeops`. * Remove the dependency of the type ops tangle on the type checker by moving some functions from `mypy.checkmember` to `mypy.typeops`. Fixes #93. Fixes #6329.
- Loading branch information
Showing
20 changed files
with
482 additions
and
435 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.