Title: On mypy libraries · Issue #724 · python/mypy · GitHub
Open Graph Title: On mypy libraries · Issue #724 · python/mypy
X Title: On mypy libraries · Issue #724 · python/mypy
Description: I notice that a lot of current and future code in the mypy repository is not strictly related to mypy's core goal of being a static type-checker. You can detect these by the fact that they have few, if any, imports from the rest of mypy....
Open Graph Description: I notice that a lot of current and future code in the mypy repository is not strictly related to mypy's core goal of being a static type-checker. You can detect these by the fact that they have few...
X Description: I notice that a lot of current and future code in the mypy repository is not strictly related to mypy's core goal of being a static type-checker. You can detect these by the fact that they have...
Opengraph URL: https://github.com/python/mypy/issues/724
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"On mypy libraries","articleBody":"I notice that a lot of current and future code in the mypy repository is not strictly related to mypy's core goal of being a static type-checker. You can detect these by the fact that they have few, if any, imports from the rest of mypy.\n\nIt would be cleaner if these were segregated to a separate package, especially for unit-testing purposes.\n\nCurrent examples of nodes that are, or are leaning, this way:\n- `codec`: Already a subpackage, which is documented to be used in a certain way, but it should be simple to keep it minimally compatible even if we figure out how to autoregister encodings.\n- `errors`: I am planning a full rewrite (in a new `mypy.syntax` package) to add column and caret support, and possibly also other output formats for machine consumption. Some of this logic is obviously mypy-specific; other parts would be useful to others.\n- `messages`: It's not clear to me why this exists at _all_ right now, but if it continues to exist, it ought to be a simple wrapper around `gettext`. Clearer vision is required to see whether or not it will have any value on its own. See also #242\n- `myunit`: I am currently doing related cleanup as part of #721 (I need a separate module to run it as `__main__` since it is also imported-from), but it would be nice if mypy tests could be run entirely by a standard test framework (I find pytest more convenient in that you don't have to arbitrarily add classes and can do proper fixtures instead of plain setup/teardown). This would make it easier to, say, collect coverage, run subsets of tests, and run tests in parallel (the current parallelization in #721 is a hack and very coarse)\n- `stubgen`: Ought to be a subpackage at least, and separate out the `__main__` logic from the look-at-python logic.\n- `util`: Although not mypy-specific, does not stand on its own. Leave it here, every project has a garbage module.\n\nAnd stuff I have created or am working on:\n- `waiter`: a module I just added as a hack to make testing less intolerable. Only truly effective on Linux with Python 3.3 or later. Might be acting funny (but correct) on Travis, but I'm not sure. The details might change significantly if we stop running on the legacy infrastructure.\n- `myargs`: an idea I have to make implement argument parsing in a typesafe _and_ readable manner, by introspecting the function/constructor annotations (with `typing.get_type_hints` - should it defer to `__init__` automatically if passed a class and `__call__` if passed any other Callable?).\n\nPossible approaches for what to do with general-purpose modules:\n1. Do nothing and keep a big jumbled mess.\n2. Move them to a single `mypylibs` package, e.g. `mypylibs.myunit`. (Name subject to bikeshedding; still will be the same pip package though).\n3. Move them to under a `mypy.libs` subpackage, e.g. `mypy.libs.myunit`. (Name subject to bikeshedding).\n4. Make them all subpackages of `mypy`, even if they would only have an `__init__.py`.\n5. Move them to top level, e.g. `myunit`.\n6. Move big ones to top level and keep the small ones under `mypy`.\n7. Move big ones to top level and keep the small ones under `mypylibs`.\n8. Move big ones to top level and keep the small ones under `mypy.libs`.\n\nMy preference is `2`, but keep open the possibility of `7`. Any such top-level packages should keep the `my*` pattern.\n","author":{"url":"https://github.com/o11c","@type":"Person","name":"o11c"},"datePublished":"2015-07-15T01:22:25Z","url":"https://github.com/python/mypy/issues/724"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:624f0bb9-4a98-a6f7-9df7-45f900a87e08 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C1F0:DD1C:2998A4D:38B8CE8:6B00504A |
| html-safe-nonce | c98a83871ae15748d394d7fe2465d116b5bece5965902d8af4e781f8269020f7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMUYwOkREMUM6Mjk5OEE0RDozOEI4Q0U4OjZCMDA1MDRBIiwidmlzaXRvcl9pZCI6IjEwNDYwNjgxMjMxNDY0MDgwMTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 35301ec8deb8485e36622f807f86e8b54a7108fe7d398e0b56916235b7166750 |
| hovercard-subject-tag | issue:95080094 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/mypy/724/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f95d93a2d6d95a56018d7e82ac8d6bb8c6ee33bbd605a81d21376431c8317330/python/mypy/issues/724 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f95d93a2d6d95a56018d7e82ac8d6bb8c6ee33bbd605a81d21376431c8317330/python/mypy/issues/724 |
| og:image:alt | I notice that a lot of current and future code in the mypy repository is not strictly related to mypy's core goal of being a static type-checker. You can detect these by the fact that they have few... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | o11c |
| hostname | github.com |
| expected-hostname | github.com |
| None | f420f4996e6b1ff1ccd6d7683f8134f4b5f0f8a50124c210dbfe7490e5644abb |
| turbo-cache-control | no-preview |
| go-import | github.com/python/mypy git https://github.com/python/mypy.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 7053637 |
| octolytics-dimension-repository_nwo | python/mypy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7053637 |
| octolytics-dimension-repository_network_root_nwo | python/mypy |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 26e00df917aba0f128135dc073ea0c5e33a70d40 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width