Title: Many uncalled functions · Issue #2279 · python/mypy · GitHub
Open Graph Title: Many uncalled functions · Issue #2279 · python/mypy
X Title: Many uncalled functions · Issue #2279 · python/mypy
Description: I wrote a small script that looks for defs that are not mentioned elsewhere. Nothing fancy or clever. Running it on mypy/*.py mypy/test/*.py yields 24 unused functions (output below). I have tried removing all of them except the 4 functi...
Open Graph Description: I wrote a small script that looks for defs that are not mentioned elsewhere. Nothing fancy or clever. Running it on mypy/*.py mypy/test/*.py yields 24 unused functions (output below). I have tried ...
X Description: I wrote a small script that looks for defs that are not mentioned elsewhere. Nothing fancy or clever. Running it on mypy/*.py mypy/test/*.py yields 24 unused functions (output below). I have tried ...
Opengraph URL: https://github.com/python/mypy/issues/2279
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Many uncalled functions","articleBody":"I wrote a [small script](https://gist.github.com/elazarg/bc9e5f326d718dcde827c13a3328a86b) that looks for `def`s that are not mentioned elsewhere. Nothing fancy or clever. \n\nRunning it on `mypy/*.py mypy/test/*.py` yields 24 unused functions (output below). I have tried removing all of them except the 4 functions from `mypy/test/data.py`, and the tests pass swiftly. After removing some of them, the script finds some more.\n\nI guess not everything is unnecessary (especially messages.py), but my guess is most of them are. And those that are needed are untested.\n\n```\nmypy/nodes.py :\n get_var_or_getter\n is_constructor\n has_writable_member\n all_base_classes\n get_var_or_setter\nmypy/checker.py :\n check_type_equivalency\n wrap_generic_type\nmypy/messages.py :\n incomplete_type_var_match\n incompatible_value_count_in_assignment\n type_expected_as_right_operand_of_is\n incompatible_array_item_type\n invalid_reverse_operator_signature\n function_variants_overlap\n type_incompatible_with_supertype\n not_implemented\n reverse_operator_method_with_any_arg_must_return_any\n boolean_return_value_expected\n incomplete_conversion_specifier_format\nmypy/build.py :\n effective_path\nmypy/semanal.py :\n is_instance_type\n add_var\nmypy/treetransform.py :\n optional_types\n duplicate_inits\nmypy/parse.py :\n expect_colon_and_break\nmypy/test/data.py :\n reportinfo\n repr_failure\n runtest\n teardown\nmypy/errors.py :\n mark_file_ignored_lines_used\n pop_import_context\n push_import_context\nmypy/checkexpr.py :\n apply_generic_arguments2\n has_non_method\n is_boolean\n```\n\n[Edit: I have added another script there. It is more sophisticated and it finds more unused functions (41), but I did not verify its results in this project so it might have more false positives]\n","author":{"url":"https://github.com/elazarg","@type":"Person","name":"elazarg"},"datePublished":"2016-10-18T20:59:53Z","url":"https://github.com/python/mypy/issues/2279"}
| 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:305025d5-828e-f6b3-f0c6-6363e808ca53 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8518:173424:1309C8:1A7337:6B005507 |
| html-safe-nonce | 17c20f3e40399e4d4d0a68ce52cf0c1e87c60793f97567d7e0162e4902b521cd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTE4OjE3MzQyNDoxMzA5Qzg6MUE3MzM3OjZCMDA1NTA3IiwidmlzaXRvcl9pZCI6Ijc0OTg5Njg4ODU3ODYzMzQ0NzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e1faf05b25c31cce89dcd071cfd0d1e8708e777487da0d49292c7dd6fce085d3 |
| hovercard-subject-tag | issue:183801560 |
| 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/2279/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0f1ecae307f0e2e750d321032f3540a42fe8dd891b5c8e17471cdc3ec0b06ef1/python/mypy/issues/2279 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0f1ecae307f0e2e750d321032f3540a42fe8dd891b5c8e17471cdc3ec0b06ef1/python/mypy/issues/2279 |
| og:image:alt | I wrote a small script that looks for defs that are not mentioned elsewhere. Nothing fancy or clever. Running it on mypy/*.py mypy/test/*.py yields 24 unused functions (output below). I have tried ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | elazarg |
| 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