@gnost-cli/darwin-arm64 0.0.1 → 0.5.1-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bundle/_internal/6ec57f84c680d3a3778b__mypyc.cpython-312-darwin.so +4 -0
- package/bundle/_internal/Python +0 -0
- package/bundle/_internal/Python.framework/Python +0 -0
- package/bundle/_internal/Python.framework/Resources/Info.plist +30 -0
- package/bundle/_internal/Python.framework/Versions/3.12/Python +0 -0
- package/bundle/_internal/Python.framework/Versions/3.12/Resources/Info.plist +30 -0
- package/bundle/_internal/Python.framework/Versions/Current/Python +0 -0
- package/bundle/_internal/Python.framework/Versions/Current/Resources/Info.plist +30 -0
- package/bundle/_internal/ast_serialize/ast_serialize.abi3.so +0 -0
- package/bundle/_internal/bandit/__init__.py +20 -0
- package/bundle/_internal/bandit/__main__.py +17 -0
- package/bundle/_internal/bandit/blacklists/__init__.py +0 -0
- package/bundle/_internal/bandit/blacklists/calls.py +670 -0
- package/bundle/_internal/bandit/blacklists/imports.py +425 -0
- package/bundle/_internal/bandit/blacklists/utils.py +17 -0
- package/bundle/_internal/bandit/cli/__init__.py +0 -0
- package/bundle/_internal/bandit/cli/baseline.py +252 -0
- package/bundle/_internal/bandit/cli/config_generator.py +207 -0
- package/bundle/_internal/bandit/cli/main.py +701 -0
- package/bundle/_internal/bandit/core/__init__.py +15 -0
- package/bundle/_internal/bandit/core/blacklisting.py +72 -0
- package/bundle/_internal/bandit/core/config.py +271 -0
- package/bundle/_internal/bandit/core/constants.py +40 -0
- package/bundle/_internal/bandit/core/context.py +316 -0
- package/bundle/_internal/bandit/core/docs_utils.py +54 -0
- package/bundle/_internal/bandit/core/extension_loader.py +114 -0
- package/bundle/_internal/bandit/core/issue.py +245 -0
- package/bundle/_internal/bandit/core/manager.py +499 -0
- package/bundle/_internal/bandit/core/meta_ast.py +44 -0
- package/bundle/_internal/bandit/core/metrics.py +106 -0
- package/bundle/_internal/bandit/core/node_visitor.py +297 -0
- package/bundle/_internal/bandit/core/test_properties.py +83 -0
- package/bundle/_internal/bandit/core/test_set.py +114 -0
- package/bundle/_internal/bandit/core/tester.py +168 -0
- package/bundle/_internal/bandit/core/utils.py +398 -0
- package/bundle/_internal/bandit/formatters/__init__.py +0 -0
- package/bundle/_internal/bandit/formatters/csv.py +82 -0
- package/bundle/_internal/bandit/formatters/custom.py +161 -0
- package/bundle/_internal/bandit/formatters/html.py +394 -0
- package/bundle/_internal/bandit/formatters/json.py +155 -0
- package/bundle/_internal/bandit/formatters/sarif.py +374 -0
- package/bundle/_internal/bandit/formatters/screen.py +244 -0
- package/bundle/_internal/bandit/formatters/text.py +200 -0
- package/bundle/_internal/bandit/formatters/utils.py +14 -0
- package/bundle/_internal/bandit/formatters/xml.py +97 -0
- package/bundle/_internal/bandit/formatters/yaml.py +126 -0
- package/bundle/_internal/bandit/plugins/__init__.py +0 -0
- package/bundle/_internal/bandit/plugins/app_debug.py +63 -0
- package/bundle/_internal/bandit/plugins/asserts.py +83 -0
- package/bundle/_internal/bandit/plugins/crypto_request_no_cert_validation.py +75 -0
- package/bundle/_internal/bandit/plugins/django_sql_injection.py +155 -0
- package/bundle/_internal/bandit/plugins/django_xss.py +287 -0
- package/bundle/_internal/bandit/plugins/exec.py +55 -0
- package/bundle/_internal/bandit/plugins/general_bad_file_permissions.py +99 -0
- package/bundle/_internal/bandit/plugins/general_bind_all_interfaces.py +52 -0
- package/bundle/_internal/bandit/plugins/general_hardcoded_password.py +282 -0
- package/bundle/_internal/bandit/plugins/general_hardcoded_tmp.py +79 -0
- package/bundle/_internal/bandit/plugins/hashlib_insecure_functions.py +121 -0
- package/bundle/_internal/bandit/plugins/huggingface_unsafe_download.py +166 -0
- package/bundle/_internal/bandit/plugins/injection_paramiko.py +63 -0
- package/bundle/_internal/bandit/plugins/injection_shell.py +706 -0
- package/bundle/_internal/bandit/plugins/injection_sql.py +143 -0
- package/bundle/_internal/bandit/plugins/injection_wildcard.py +144 -0
- package/bundle/_internal/bandit/plugins/insecure_ssl_tls.py +285 -0
- package/bundle/_internal/bandit/plugins/jinja2_templates.py +134 -0
- package/bundle/_internal/bandit/plugins/logging_config_insecure_listen.py +58 -0
- package/bundle/_internal/bandit/plugins/mako_templates.py +69 -0
- package/bundle/_internal/bandit/plugins/markupsafe_markup_xss.py +118 -0
- package/bundle/_internal/bandit/plugins/pytorch_load.py +77 -0
- package/bundle/_internal/bandit/plugins/request_without_timeout.py +84 -0
- package/bundle/_internal/bandit/plugins/snmp_security_check.py +110 -0
- package/bundle/_internal/bandit/plugins/ssh_no_host_key_verification.py +76 -0
- package/bundle/_internal/bandit/plugins/tarfile_unsafe_members.py +121 -0
- package/bundle/_internal/bandit/plugins/trojansource.py +82 -0
- package/bundle/_internal/bandit/plugins/try_except_continue.py +108 -0
- package/bundle/_internal/bandit/plugins/try_except_pass.py +106 -0
- package/bundle/_internal/bandit/plugins/weak_cryptographic_key.py +165 -0
- package/bundle/_internal/bandit/plugins/yaml_load.py +76 -0
- package/bundle/_internal/bandit-1.9.4.dist-info/INSTALLER +1 -0
- package/bundle/_internal/bandit-1.9.4.dist-info/METADATA +212 -0
- package/bundle/_internal/bandit-1.9.4.dist-info/RECORD +150 -0
- package/bundle/_internal/bandit-1.9.4.dist-info/WHEEL +5 -0
- package/bundle/_internal/bandit-1.9.4.dist-info/entry_points.txt +63 -0
- package/bundle/_internal/bandit-1.9.4.dist-info/licenses/LICENSE +175 -0
- package/bundle/_internal/bandit-1.9.4.dist-info/pbr.json +1 -0
- package/bundle/_internal/bandit-1.9.4.dist-info/top_level.txt +1 -0
- package/bundle/_internal/base_library.zip +0 -0
- package/bundle/_internal/bin/ruff +0 -0
- package/bundle/_internal/gnost/__init__.py +1 -0
- package/bundle/_internal/gnost/analysis/__init__.py +0 -0
- package/bundle/_internal/gnost/analysis/analyzers/__init__.py +11 -0
- package/bundle/_internal/gnost/analysis/analyzers/maintainability_analyzer.py +901 -0
- package/bundle/_internal/gnost/analysis/analyzers/observability_analyzer.py +592 -0
- package/bundle/_internal/gnost/analysis/analyzers/readability_analyzer.py +968 -0
- package/bundle/_internal/gnost/analysis/analyzers/robustness_analyzer.py +944 -0
- package/bundle/_internal/gnost/analysis/config/mypy.ini +4 -0
- package/bundle/_internal/gnost/analysis/core/__init__.py +0 -0
- package/bundle/_internal/gnost/analysis/core/aggregator.py +584 -0
- package/bundle/_internal/gnost/analysis/core/engine.py +430 -0
- package/bundle/_internal/gnost/analysis/core/file_utils.py +209 -0
- package/bundle/_internal/gnost/analysis/core/interfaces.py +304 -0
- package/bundle/_internal/gnost/analysis/core/models.py +479 -0
- package/bundle/_internal/gnost/analysis/core/tool_runner.py +153 -0
- package/bundle/_internal/gnost/analysis/core/transformers.py +779 -0
- package/bundle/_internal/gnost/analysis/utils/__init__.py +0 -0
- package/bundle/_internal/gnost/analysis/utils/analyze.py +132 -0
- package/bundle/_internal/gnost/analysis/utils/df_handling.py +215 -0
- package/bundle/_internal/gnost/analysis/utils/duplicate_code.py +42 -0
- package/bundle/_internal/gnost/analysis/utils/extract.py +172 -0
- package/bundle/_internal/gnost/analysis/utils/mi.py +130 -0
- package/bundle/_internal/gnost/analysis/utils/tool_command.py +63 -0
- package/bundle/_internal/gnost/cli/__init__.py +3 -0
- package/bundle/_internal/gnost/cli/app.py +696 -0
- package/bundle/_internal/gnost/cli/commands/__init__.py +3 -0
- package/bundle/_internal/gnost/cli/commands/analysis.py +190 -0
- package/bundle/_internal/gnost/cli/commands/onboard.py +507 -0
- package/bundle/_internal/gnost/cli/commands/show.py +70 -0
- package/bundle/_internal/gnost/config/__init__.py +0 -0
- package/bundle/_internal/gnost/config/languages.py +10 -0
- package/bundle/_internal/gnost/config/settings.py +240 -0
- package/bundle/_internal/gnost/core/__init__.py +0 -0
- package/bundle/_internal/gnost/core/callgraph.py +399 -0
- package/bundle/_internal/gnost/core/caution.py +315 -0
- package/bundle/_internal/gnost/core/cycles.py +148 -0
- package/bundle/_internal/gnost/core/flow.py +204 -0
- package/bundle/_internal/gnost/core/graph.py +108 -0
- package/bundle/_internal/gnost/core/insight_builder.py +164 -0
- package/bundle/_internal/gnost/core/ranker.py +119 -0
- package/bundle/_internal/gnost/core/resolver.py +304 -0
- package/bundle/_internal/gnost/languages/base.py +108 -0
- package/bundle/_internal/gnost/languages/java.py +104 -0
- package/bundle/_internal/gnost/languages/javascript.py +153 -0
- package/bundle/_internal/gnost/languages/manifests.py +45 -0
- package/bundle/_internal/gnost/languages/python.py +318 -0
- package/bundle/_internal/gnost/languages/typescript.py +6 -0
- package/bundle/_internal/gnost/models/__init__.py +0 -0
- package/bundle/_internal/gnost/models/insights.py +68 -0
- package/bundle/_internal/gnost/reporters/__init__.py +3 -0
- package/bundle/_internal/gnost/reporters/analysis_html.py +1292 -0
- package/bundle/_internal/gnost/reporters/diagram_viewer.py +153 -0
- package/bundle/_internal/gnost/reporters/files.py +18 -0
- package/bundle/_internal/gnost/reporters/folders.py +18 -0
- package/bundle/_internal/gnost/reporters/insights_json.py +189 -0
- package/bundle/_internal/gnost/reporters/loc_summary.py +19 -0
- package/bundle/_internal/gnost/reporters/markdown.py +372 -0
- package/bundle/_internal/gnost/reporters/mermaid.py +543 -0
- package/bundle/_internal/gnost/reporters/mermaid_graph.py +309 -0
- package/bundle/_internal/gnost/reporters/readme.py +81 -0
- package/bundle/_internal/gnost/reporters/stats.py +13 -0
- package/bundle/_internal/gnost/reporters/summary.py +223 -0
- package/bundle/_internal/gnost/reporters/templates/analyzer_guides.json +247 -0
- package/bundle/_internal/gnost/reporters/templates/analyzer_guides_layout.html +9 -0
- package/bundle/_internal/gnost/reporters/templates/graph_viewer.html +427 -0
- package/bundle/_internal/gnost/reporters/vendor/THIRD_PARTY_NOTICES.md +205 -0
- package/bundle/_internal/gnost/reporters/vendor/cose-base.js +3214 -0
- package/bundle/_internal/gnost/reporters/vendor/cytoscape-fcose.js +1549 -0
- package/bundle/_internal/gnost/reporters/vendor/cytoscape.min.js +32 -0
- package/bundle/_internal/gnost/reporters/vendor/layout-base.js +5230 -0
- package/bundle/_internal/gnost/reporters/vendor/marked.min.js +6 -0
- package/bundle/_internal/gnost/reporters/vendor/mermaid.min.js +2314 -0
- package/bundle/_internal/gnost/reporters/vendor/svg-pan-zoom.min.js +3 -0
- package/bundle/_internal/gnost/reporters/vendor/vendor.json +44 -0
- package/bundle/_internal/gnost/routes/__init__.py +45 -0
- package/bundle/_internal/gnost/routes/java.py +72 -0
- package/bundle/_internal/gnost/routes/javascript.py +275 -0
- package/bundle/_internal/gnost/routes/models.py +58 -0
- package/bundle/_internal/gnost/routes/python.py +429 -0
- package/bundle/_internal/gnost/scanner/__init__.py +4 -0
- package/bundle/_internal/gnost/scanner/classify.py +13 -0
- package/bundle/_internal/gnost/scanner/engine.py +169 -0
- package/bundle/_internal/gnost/scanner/filters.py +197 -0
- package/bundle/_internal/gnost/scanner/loc.py +93 -0
- package/bundle/_internal/gnost/scanner/models.py +27 -0
- package/bundle/_internal/gnost/schemas/insights.schema.json +517 -0
- package/bundle/_internal/gnost/utils/__init__.py +0 -0
- package/bundle/_internal/gnost/utils/logger.py +85 -0
- package/bundle/_internal/gnost/utils/paths.py +29 -0
- package/bundle/_internal/gnost/utils/printer.py +46 -0
- package/bundle/_internal/gnost/utils/progress.py +20 -0
- package/bundle/_internal/gnost-0.5.1rc2.dist-info/INSTALLER +1 -0
- package/bundle/_internal/gnost-0.5.1rc2.dist-info/METADATA +130 -0
- package/bundle/_internal/gnost-0.5.1rc2.dist-info/RECORD +178 -0
- package/bundle/_internal/gnost-0.5.1rc2.dist-info/REQUESTED +0 -0
- package/bundle/_internal/gnost-0.5.1rc2.dist-info/WHEEL +5 -0
- package/bundle/_internal/gnost-0.5.1rc2.dist-info/direct_url.json +1 -0
- package/bundle/_internal/gnost-0.5.1rc2.dist-info/entry_points.txt +2 -0
- package/bundle/_internal/gnost-0.5.1rc2.dist-info/licenses/LICENSE +21 -0
- package/bundle/_internal/gnost-0.5.1rc2.dist-info/top_level.txt +1 -0
- package/bundle/_internal/libcrypto.3.dylib +0 -0
- package/bundle/_internal/libncurses.6.dylib +0 -0
- package/bundle/_internal/librt/base64.cpython-312-darwin.so +0 -0
- package/bundle/_internal/librt/internal.cpython-312-darwin.so +0 -0
- package/bundle/_internal/libssl.3.dylib +0 -0
- package/bundle/_internal/mypy/__init__.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/__init__.py +1 -0
- package/bundle/_internal/mypy/__main__.py +52 -0
- package/bundle/_internal/mypy/api.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/api.py +95 -0
- package/bundle/_internal/mypy/applytype.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/applytype.py +317 -0
- package/bundle/_internal/mypy/argmap.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/argmap.py +269 -0
- package/bundle/_internal/mypy/binder.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/binder.py +710 -0
- package/bundle/_internal/mypy/bogus_type.py +27 -0
- package/bundle/_internal/mypy/build.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/build.py +5533 -0
- package/bundle/_internal/mypy/build_worker/__init__.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/build_worker/__init__.py +0 -0
- package/bundle/_internal/mypy/build_worker/__main__.py +6 -0
- package/bundle/_internal/mypy/build_worker/worker.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/build_worker/worker.py +379 -0
- package/bundle/_internal/mypy/cache.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/cache.py +626 -0
- package/bundle/_internal/mypy/checker.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/checker.py +10110 -0
- package/bundle/_internal/mypy/checker_shared.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/checker_shared.py +377 -0
- package/bundle/_internal/mypy/checker_state.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/checker_state.py +30 -0
- package/bundle/_internal/mypy/checkexpr.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/checkexpr.py +7018 -0
- package/bundle/_internal/mypy/checkmember.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/checkmember.py +1593 -0
- package/bundle/_internal/mypy/checkpattern.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/checkpattern.py +883 -0
- package/bundle/_internal/mypy/checkstrformat.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/checkstrformat.py +1103 -0
- package/bundle/_internal/mypy/config_parser.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/config_parser.py +749 -0
- package/bundle/_internal/mypy/constant_fold.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/constant_fold.py +187 -0
- package/bundle/_internal/mypy/constraints.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/constraints.py +1748 -0
- package/bundle/_internal/mypy/copytype.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/copytype.py +137 -0
- package/bundle/_internal/mypy/defaults.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/defaults.py +67 -0
- package/bundle/_internal/mypy/dmypy/__init__.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/dmypy/__init__.py +0 -0
- package/bundle/_internal/mypy/dmypy/__main__.py +6 -0
- package/bundle/_internal/mypy/dmypy/client.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/dmypy/client.py +732 -0
- package/bundle/_internal/mypy/dmypy_os.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/dmypy_os.py +43 -0
- package/bundle/_internal/mypy/dmypy_server.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/dmypy_server.py +1132 -0
- package/bundle/_internal/mypy/dmypy_util.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/dmypy_util.py +117 -0
- package/bundle/_internal/mypy/erasetype.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/erasetype.py +301 -0
- package/bundle/_internal/mypy/error_formatter.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/error_formatter.py +39 -0
- package/bundle/_internal/mypy/errorcodes.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/errorcodes.py +340 -0
- package/bundle/_internal/mypy/errors.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/errors.py +1468 -0
- package/bundle/_internal/mypy/evalexpr.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/evalexpr.py +211 -0
- package/bundle/_internal/mypy/expandtype.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/expandtype.py +662 -0
- package/bundle/_internal/mypy/exportjson.py +616 -0
- package/bundle/_internal/mypy/exprtotype.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/exprtotype.py +285 -0
- package/bundle/_internal/mypy/fastparse.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/fastparse.py +2267 -0
- package/bundle/_internal/mypy/find_sources.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/find_sources.py +257 -0
- package/bundle/_internal/mypy/fixup.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/fixup.py +438 -0
- package/bundle/_internal/mypy/freetree.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/freetree.py +23 -0
- package/bundle/_internal/mypy/fscache.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/fscache.py +312 -0
- package/bundle/_internal/mypy/fswatcher.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/fswatcher.py +106 -0
- package/bundle/_internal/mypy/gclogger.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/gclogger.py +48 -0
- package/bundle/_internal/mypy/git.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/git.py +69 -0
- package/bundle/_internal/mypy/graph_utils.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/graph_utils.py +161 -0
- package/bundle/_internal/mypy/indirection.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/indirection.py +176 -0
- package/bundle/_internal/mypy/infer.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/infer.py +80 -0
- package/bundle/_internal/mypy/inspections.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/inspections.py +626 -0
- package/bundle/_internal/mypy/ipc.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/ipc.py +508 -0
- package/bundle/_internal/mypy/join.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/join.py +962 -0
- package/bundle/_internal/mypy/known_modules.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/known_modules.py +174 -0
- package/bundle/_internal/mypy/literals.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/literals.py +327 -0
- package/bundle/_internal/mypy/lookup.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/lookup.py +80 -0
- package/bundle/_internal/mypy/main.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/main.py +1793 -0
- package/bundle/_internal/mypy/maptype.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/maptype.py +109 -0
- package/bundle/_internal/mypy/meet.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/meet.py +1371 -0
- package/bundle/_internal/mypy/memprofile.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/memprofile.py +122 -0
- package/bundle/_internal/mypy/message_registry.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/message_registry.py +378 -0
- package/bundle/_internal/mypy/messages.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/messages.py +3535 -0
- package/bundle/_internal/mypy/metastore.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/metastore.py +278 -0
- package/bundle/_internal/mypy/mixedtraverser.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/mixedtraverser.py +147 -0
- package/bundle/_internal/mypy/modulefinder.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/modulefinder.py +1008 -0
- package/bundle/_internal/mypy/moduleinspect.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/moduleinspect.py +184 -0
- package/bundle/_internal/mypy/modules_state.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/modules_state.py +20 -0
- package/bundle/_internal/mypy/mro.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/mro.py +62 -0
- package/bundle/_internal/mypy/nativeparse.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/nativeparse.py +2199 -0
- package/bundle/_internal/mypy/nodes.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/nodes.py +5608 -0
- package/bundle/_internal/mypy/operators.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/operators.py +126 -0
- package/bundle/_internal/mypy/options.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/options.py +678 -0
- package/bundle/_internal/mypy/parse.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/parse.py +135 -0
- package/bundle/_internal/mypy/partially_defined.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/partially_defined.py +703 -0
- package/bundle/_internal/mypy/patterns.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/patterns.py +162 -0
- package/bundle/_internal/mypy/plugin.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/plugin.py +945 -0
- package/bundle/_internal/mypy/plugins/__init__.py +0 -0
- package/bundle/_internal/mypy/plugins/attrs.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/plugins/attrs.py +1179 -0
- package/bundle/_internal/mypy/plugins/common.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/plugins/common.py +441 -0
- package/bundle/_internal/mypy/plugins/constants.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/plugins/constants.py +20 -0
- package/bundle/_internal/mypy/plugins/ctypes.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/plugins/ctypes.py +245 -0
- package/bundle/_internal/mypy/plugins/dataclasses.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/plugins/dataclasses.py +1135 -0
- package/bundle/_internal/mypy/plugins/default.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/plugins/default.py +612 -0
- package/bundle/_internal/mypy/plugins/enums.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/plugins/enums.py +299 -0
- package/bundle/_internal/mypy/plugins/functools.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/plugins/functools.py +399 -0
- package/bundle/_internal/mypy/plugins/proper_plugin.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/plugins/proper_plugin.py +178 -0
- package/bundle/_internal/mypy/plugins/singledispatch.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/plugins/singledispatch.py +212 -0
- package/bundle/_internal/mypy/py.typed +1 -0
- package/bundle/_internal/mypy/pyinfo.py +79 -0
- package/bundle/_internal/mypy/reachability.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/reachability.py +388 -0
- package/bundle/_internal/mypy/refinfo.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/refinfo.py +92 -0
- package/bundle/_internal/mypy/renaming.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/renaming.py +583 -0
- package/bundle/_internal/mypy/report.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/report.py +930 -0
- package/bundle/_internal/mypy/scope.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/scope.py +125 -0
- package/bundle/_internal/mypy/semanal.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/semanal.py +8674 -0
- package/bundle/_internal/mypy/semanal_classprop.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/semanal_classprop.py +188 -0
- package/bundle/_internal/mypy/semanal_enum.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/semanal_enum.py +259 -0
- package/bundle/_internal/mypy/semanal_infer.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/semanal_infer.py +135 -0
- package/bundle/_internal/mypy/semanal_main.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/semanal_main.py +542 -0
- package/bundle/_internal/mypy/semanal_namedtuple.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/semanal_namedtuple.py +679 -0
- package/bundle/_internal/mypy/semanal_newtype.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/semanal_newtype.py +272 -0
- package/bundle/_internal/mypy/semanal_pass1.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/semanal_pass1.py +159 -0
- package/bundle/_internal/mypy/semanal_shared.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/semanal_shared.py +499 -0
- package/bundle/_internal/mypy/semanal_typeargs.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/semanal_typeargs.py +309 -0
- package/bundle/_internal/mypy/semanal_typeddict.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/semanal_typeddict.py +826 -0
- package/bundle/_internal/mypy/server/__init__.py +0 -0
- package/bundle/_internal/mypy/server/astdiff.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/server/astdiff.py +552 -0
- package/bundle/_internal/mypy/server/astmerge.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/server/astmerge.py +583 -0
- package/bundle/_internal/mypy/server/aststrip.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/server/aststrip.py +255 -0
- package/bundle/_internal/mypy/server/deps.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/server/deps.py +1153 -0
- package/bundle/_internal/mypy/server/mergecheck.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/server/mergecheck.py +84 -0
- package/bundle/_internal/mypy/server/objgraph.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/server/objgraph.py +101 -0
- package/bundle/_internal/mypy/server/subexpr.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/server/subexpr.py +208 -0
- package/bundle/_internal/mypy/server/target.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/server/target.py +11 -0
- package/bundle/_internal/mypy/server/trigger.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/server/trigger.py +26 -0
- package/bundle/_internal/mypy/server/update.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/server/update.py +1372 -0
- package/bundle/_internal/mypy/sharedparse.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/sharedparse.py +114 -0
- package/bundle/_internal/mypy/solve.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/solve.py +602 -0
- package/bundle/_internal/mypy/split_namespace.py +35 -0
- package/bundle/_internal/mypy/state.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/state.py +29 -0
- package/bundle/_internal/mypy/stats.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/stats.py +494 -0
- package/bundle/_internal/mypy/strconv.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/strconv.py +707 -0
- package/bundle/_internal/mypy/stubdoc.py +545 -0
- package/bundle/_internal/mypy/stubgen.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/stubgen.py +2064 -0
- package/bundle/_internal/mypy/stubgenc.py +1046 -0
- package/bundle/_internal/mypy/stubinfo.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/stubinfo.py +321 -0
- package/bundle/_internal/mypy/stubtest.py +2676 -0
- package/bundle/_internal/mypy/stubutil.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/stubutil.py +895 -0
- package/bundle/_internal/mypy/subtypes.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/subtypes.py +2572 -0
- package/bundle/_internal/mypy/suggestions.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/suggestions.py +1068 -0
- package/bundle/_internal/mypy/test/__init__.py +0 -0
- package/bundle/_internal/mypy/test/config.py +31 -0
- package/bundle/_internal/mypy/test/data.py +864 -0
- package/bundle/_internal/mypy/test/helpers.py +546 -0
- package/bundle/_internal/mypy/test/meta/__init__.py +0 -0
- package/bundle/_internal/mypy/test/meta/_pytest.py +72 -0
- package/bundle/_internal/mypy/test/meta/test_diff_helper.py +47 -0
- package/bundle/_internal/mypy/test/meta/test_parse_data.py +69 -0
- package/bundle/_internal/mypy/test/meta/test_update_data.py +131 -0
- package/bundle/_internal/mypy/test/test_config_parser.py +130 -0
- package/bundle/_internal/mypy/test/test_diff_cache.py +209 -0
- package/bundle/_internal/mypy/test/test_find_sources.py +376 -0
- package/bundle/_internal/mypy/test/test_nativeparse.py +306 -0
- package/bundle/_internal/mypy/test/test_ref_info.py +46 -0
- package/bundle/_internal/mypy/test/testapi.py +45 -0
- package/bundle/_internal/mypy/test/testargs.py +202 -0
- package/bundle/_internal/mypy/test/testcheck.py +360 -0
- package/bundle/_internal/mypy/test/testcmdline.py +162 -0
- package/bundle/_internal/mypy/test/testconstraints.py +134 -0
- package/bundle/_internal/mypy/test/testdaemon.py +132 -0
- package/bundle/_internal/mypy/test/testdeps.py +85 -0
- package/bundle/_internal/mypy/test/testdiff.py +70 -0
- package/bundle/_internal/mypy/test/testerrorstream.py +46 -0
- package/bundle/_internal/mypy/test/testexportjson.py +104 -0
- package/bundle/_internal/mypy/test/testfinegrained.py +453 -0
- package/bundle/_internal/mypy/test/testfinegrainedcache.py +18 -0
- package/bundle/_internal/mypy/test/testformatter.py +85 -0
- package/bundle/_internal/mypy/test/testfscache.py +100 -0
- package/bundle/_internal/mypy/test/testgraph.py +138 -0
- package/bundle/_internal/mypy/test/testinfer.py +373 -0
- package/bundle/_internal/mypy/test/testipc.py +154 -0
- package/bundle/_internal/mypy/test/testmerge.py +235 -0
- package/bundle/_internal/mypy/test/testmodulefinder.py +284 -0
- package/bundle/_internal/mypy/test/testmypyc.py +26 -0
- package/bundle/_internal/mypy/test/testoutput.py +64 -0
- package/bundle/_internal/mypy/test/testparse.py +131 -0
- package/bundle/_internal/mypy/test/testpep561.py +174 -0
- package/bundle/_internal/mypy/test/testpythoneval.py +116 -0
- package/bundle/_internal/mypy/test/testreports.py +59 -0
- package/bundle/_internal/mypy/test/testsemanal.py +219 -0
- package/bundle/_internal/mypy/test/testsolve.py +287 -0
- package/bundle/_internal/mypy/test/teststubgen.py +1650 -0
- package/bundle/_internal/mypy/test/teststubinfo.py +24 -0
- package/bundle/_internal/mypy/test/teststubtest.py +3417 -0
- package/bundle/_internal/mypy/test/testsubtypes.py +306 -0
- package/bundle/_internal/mypy/test/testtransform.py +64 -0
- package/bundle/_internal/mypy/test/testtypegen.py +83 -0
- package/bundle/_internal/mypy/test/testtypes.py +1666 -0
- package/bundle/_internal/mypy/test/testutil.py +111 -0
- package/bundle/_internal/mypy/test/typefixture.py +419 -0
- package/bundle/_internal/mypy/test/update_data.py +87 -0
- package/bundle/_internal/mypy/test/visitors.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/test/visitors.py +77 -0
- package/bundle/_internal/mypy/traverser.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/traverser.py +1106 -0
- package/bundle/_internal/mypy/treetransform.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/treetransform.py +820 -0
- package/bundle/_internal/mypy/tvar_scope.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/tvar_scope.py +154 -0
- package/bundle/_internal/mypy/type_visitor.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/type_visitor.py +630 -0
- package/bundle/_internal/mypy/typeanal.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/typeanal.py +2961 -0
- package/bundle/_internal/mypy/typeops.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/typeops.py +1355 -0
- package/bundle/_internal/mypy/types.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/types.py +4639 -0
- package/bundle/_internal/mypy/types_utils.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/types_utils.py +183 -0
- package/bundle/_internal/mypy/typeshed/LICENSE +237 -0
- package/bundle/_internal/mypy/typeshed/stdlib/VERSIONS +349 -0
- package/bundle/_internal/mypy/typeshed/stdlib/__future__.pyi +36 -0
- package/bundle/_internal/mypy/typeshed/stdlib/__main__.pyi +1 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_ast.pyi +141 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_asyncio.pyi +114 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_bisect.pyi +103 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_blake2.pyi +119 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_bz2.pyi +24 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_codecs.pyi +125 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_collections_abc.pyi +105 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_compat_pickle.pyi +10 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_compression.pyi +39 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_contextvars.pyi +69 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_csv.pyi +116 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_ctypes.pyi +375 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_curses.pyi +583 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_curses_panel.pyi +27 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_dbm.pyi +46 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_decimal.pyi +73 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_frozen_importlib.pyi +121 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_frozen_importlib_external.pyi +218 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_gdbm.pyi +50 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_hashlib.pyi +127 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_heapq.pyi +18 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_imp.pyi +30 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_interpchannels.pyi +86 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_interpqueues.pyi +31 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_interpreters.pyi +68 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_io.pyi +330 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_json.pyi +59 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_locale.pyi +121 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_lsprof.pyi +34 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_lzma.pyi +71 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_markupbase.pyi +10 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_msi.pyi +97 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_multibytecodec.pyi +49 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_operator.pyi +130 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_osx_support.pyi +34 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_pickle.pyi +114 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_posixsubprocess.pyi +59 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_py_abc.pyi +14 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_pydecimal.pyi +50 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_queue.pyi +18 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_random.pyi +14 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_remote_debugging.pyi +186 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_sitebuiltins.pyi +18 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_socket.pyi +966 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_sqlite3.pyi +311 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_ssl.pyi +303 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_stat.pyi +119 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_struct.pyi +24 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_thread.pyi +125 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_threading_local.pyi +24 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_tkinter.pyi +156 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_tracemalloc.pyi +13 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_typeshed/README.md +34 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_typeshed/__init__.pyi +415 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_typeshed/_type_checker_internals.pyi +102 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_typeshed/dbapi.pyi +36 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_typeshed/importlib.pyi +18 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_typeshed/wsgi.pyi +43 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_typeshed/xml.pyi +9 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_warnings.pyi +54 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_weakref.pyi +15 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_weakrefset.pyi +49 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_winapi.pyi +319 -0
- package/bundle/_internal/mypy/typeshed/stdlib/_zstd.pyi +102 -0
- package/bundle/_internal/mypy/typeshed/stdlib/abc.pyi +50 -0
- package/bundle/_internal/mypy/typeshed/stdlib/aifc.pyi +79 -0
- package/bundle/_internal/mypy/typeshed/stdlib/annotationlib.pyi +156 -0
- package/bundle/_internal/mypy/typeshed/stdlib/antigravity.pyi +3 -0
- package/bundle/_internal/mypy/typeshed/stdlib/argparse.pyi +866 -0
- package/bundle/_internal/mypy/typeshed/stdlib/array.pyi +113 -0
- package/bundle/_internal/mypy/typeshed/stdlib/ast.pyi +2199 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asynchat.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/__init__.pyi +1022 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/base_events.pyi +607 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/base_futures.pyi +17 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/base_subprocess.pyi +62 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/base_tasks.pyi +17 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/constants.pyi +20 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/coroutines.pyi +45 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/events.pyi +803 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/exceptions.pyi +44 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/format_helpers.pyi +31 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/futures.pyi +19 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/graph.pyi +29 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/locks.pyi +83 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/log.pyi +3 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/mixins.pyi +9 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/proactor_events.pyi +53 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/protocols.pyi +39 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/queues.pyi +45 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/runners.pyi +41 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/selector_events.pyi +10 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/sslproto.pyi +164 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/staggered.pyi +10 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/streams.pyi +124 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/subprocess.pyi +166 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/taskgroups.pyi +41 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/tasks.pyi +315 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/threads.pyi +9 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/timeouts.pyi +20 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/tools.pyi +51 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/transports.pyi +57 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/trsock.pyi +137 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/unix_events.pyi +277 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/windows_events.pyi +122 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncio/windows_utils.pyi +49 -0
- package/bundle/_internal/mypy/typeshed/stdlib/asyncore.pyi +91 -0
- package/bundle/_internal/mypy/typeshed/stdlib/atexit.pyi +11 -0
- package/bundle/_internal/mypy/typeshed/stdlib/audioop.pyi +44 -0
- package/bundle/_internal/mypy/typeshed/stdlib/base64.pyi +124 -0
- package/bundle/_internal/mypy/typeshed/stdlib/bdb.pyi +139 -0
- package/bundle/_internal/mypy/typeshed/stdlib/binascii.pyi +102 -0
- package/bundle/_internal/mypy/typeshed/stdlib/binhex.pyi +44 -0
- package/bundle/_internal/mypy/typeshed/stdlib/bisect.pyi +4 -0
- package/bundle/_internal/mypy/typeshed/stdlib/builtins.pyi +2470 -0
- package/bundle/_internal/mypy/typeshed/stdlib/bz2.pyi +121 -0
- package/bundle/_internal/mypy/typeshed/stdlib/cProfile.pyi +33 -0
- package/bundle/_internal/mypy/typeshed/stdlib/calendar.pyi +249 -0
- package/bundle/_internal/mypy/typeshed/stdlib/cgi.pyi +120 -0
- package/bundle/_internal/mypy/typeshed/stdlib/cgitb.pyi +32 -0
- package/bundle/_internal/mypy/typeshed/stdlib/chunk.pyi +20 -0
- package/bundle/_internal/mypy/typeshed/stdlib/cmath.pyi +36 -0
- package/bundle/_internal/mypy/typeshed/stdlib/cmd.pyi +46 -0
- package/bundle/_internal/mypy/typeshed/stdlib/code.pyi +55 -0
- package/bundle/_internal/mypy/typeshed/stdlib/codecs.pyi +357 -0
- package/bundle/_internal/mypy/typeshed/stdlib/codeop.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/collections/__init__.pyi +565 -0
- package/bundle/_internal/mypy/typeshed/stdlib/collections/abc.pyi +2 -0
- package/bundle/_internal/mypy/typeshed/stdlib/colorsys.pyi +15 -0
- package/bundle/_internal/mypy/typeshed/stdlib/compileall.pyi +51 -0
- package/bundle/_internal/mypy/typeshed/stdlib/compression/__init__.pyi +0 -0
- package/bundle/_internal/mypy/typeshed/stdlib/compression/_common/__init__.pyi +0 -0
- package/bundle/_internal/mypy/typeshed/stdlib/compression/_common/_streams.pyi +37 -0
- package/bundle/_internal/mypy/typeshed/stdlib/compression/bz2.pyi +1 -0
- package/bundle/_internal/mypy/typeshed/stdlib/compression/gzip.pyi +1 -0
- package/bundle/_internal/mypy/typeshed/stdlib/compression/lzma.pyi +1 -0
- package/bundle/_internal/mypy/typeshed/stdlib/compression/zlib.pyi +1 -0
- package/bundle/_internal/mypy/typeshed/stdlib/compression/zstd/__init__.pyi +94 -0
- package/bundle/_internal/mypy/typeshed/stdlib/compression/zstd/_zstdfile.pyi +117 -0
- package/bundle/_internal/mypy/typeshed/stdlib/concurrent/__init__.pyi +0 -0
- package/bundle/_internal/mypy/typeshed/stdlib/concurrent/futures/__init__.pyi +71 -0
- package/bundle/_internal/mypy/typeshed/stdlib/concurrent/futures/_base.pyi +119 -0
- package/bundle/_internal/mypy/typeshed/stdlib/concurrent/futures/interpreter.pyi +82 -0
- package/bundle/_internal/mypy/typeshed/stdlib/concurrent/futures/process.pyi +248 -0
- package/bundle/_internal/mypy/typeshed/stdlib/concurrent/futures/thread.pyi +143 -0
- package/bundle/_internal/mypy/typeshed/stdlib/concurrent/interpreters/__init__.pyi +68 -0
- package/bundle/_internal/mypy/typeshed/stdlib/concurrent/interpreters/_crossinterp.pyi +30 -0
- package/bundle/_internal/mypy/typeshed/stdlib/concurrent/interpreters/_queues.pyi +74 -0
- package/bundle/_internal/mypy/typeshed/stdlib/configparser.pyi +509 -0
- package/bundle/_internal/mypy/typeshed/stdlib/contextlib.pyi +211 -0
- package/bundle/_internal/mypy/typeshed/stdlib/contextvars.pyi +3 -0
- package/bundle/_internal/mypy/typeshed/stdlib/copy.pyi +37 -0
- package/bundle/_internal/mypy/typeshed/stdlib/copyreg.pyi +20 -0
- package/bundle/_internal/mypy/typeshed/stdlib/crypt.pyi +26 -0
- package/bundle/_internal/mypy/typeshed/stdlib/csv.pyi +153 -0
- package/bundle/_internal/mypy/typeshed/stdlib/ctypes/__init__.pyi +394 -0
- package/bundle/_internal/mypy/typeshed/stdlib/ctypes/_endian.pyi +16 -0
- package/bundle/_internal/mypy/typeshed/stdlib/ctypes/macholib/__init__.pyi +3 -0
- package/bundle/_internal/mypy/typeshed/stdlib/ctypes/macholib/dyld.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/ctypes/macholib/dylib.pyi +14 -0
- package/bundle/_internal/mypy/typeshed/stdlib/ctypes/macholib/framework.pyi +14 -0
- package/bundle/_internal/mypy/typeshed/stdlib/ctypes/util.pyi +11 -0
- package/bundle/_internal/mypy/typeshed/stdlib/ctypes/wintypes.pyi +321 -0
- package/bundle/_internal/mypy/typeshed/stdlib/curses/__init__.pyi +38 -0
- package/bundle/_internal/mypy/typeshed/stdlib/curses/ascii.pyi +62 -0
- package/bundle/_internal/mypy/typeshed/stdlib/curses/has_key.pyi +1 -0
- package/bundle/_internal/mypy/typeshed/stdlib/curses/panel.pyi +1 -0
- package/bundle/_internal/mypy/typeshed/stdlib/curses/textpad.pyi +11 -0
- package/bundle/_internal/mypy/typeshed/stdlib/dataclasses.pyi +401 -0
- package/bundle/_internal/mypy/typeshed/stdlib/datetime.pyi +381 -0
- package/bundle/_internal/mypy/typeshed/stdlib/dbm/__init__.pyi +105 -0
- package/bundle/_internal/mypy/typeshed/stdlib/dbm/dumb.pyi +41 -0
- package/bundle/_internal/mypy/typeshed/stdlib/dbm/gnu.pyi +1 -0
- package/bundle/_internal/mypy/typeshed/stdlib/dbm/ndbm.pyi +1 -0
- package/bundle/_internal/mypy/typeshed/stdlib/dbm/sqlite3.pyi +34 -0
- package/bundle/_internal/mypy/typeshed/stdlib/decimal.pyi +278 -0
- package/bundle/_internal/mypy/typeshed/stdlib/difflib.pyi +157 -0
- package/bundle/_internal/mypy/typeshed/stdlib/dis.pyi +302 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/__init__.pyi +5 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/_msvccompiler.pyi +13 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/archive_util.pyi +36 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/bcppcompiler.pyi +3 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/ccompiler.pyi +182 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/cmd.pyi +238 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/__init__.pyi +41 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/bdist.pyi +27 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/bdist_dumb.pyi +22 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/bdist_msi.pyi +45 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/bdist_packager.pyi +0 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/bdist_rpm.pyi +53 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/build.pyi +34 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/build_clib.pyi +29 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/build_ext.pyi +52 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/build_py.pyi +45 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/build_scripts.pyi +25 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/check.pyi +39 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/clean.pyi +18 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/config.pyi +84 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/install.pyi +67 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/install_data.pyi +20 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/install_egg_info.pyi +19 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/install_headers.pyi +17 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/install_lib.pyi +26 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/install_scripts.pyi +19 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/register.pyi +20 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/sdist.pyi +45 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/upload.pyi +18 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/config.pyi +17 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/core.pyi +58 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/cygwinccompiler.pyi +20 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/debug.pyi +3 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/dep_util.pyi +14 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/dir_util.pyi +23 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/dist.pyi +318 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/errors.pyi +19 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/extension.pyi +36 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/fancy_getopt.pyi +45 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/file_util.pyi +40 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/filelist.pyi +61 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/log.pyi +26 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/msvccompiler.pyi +3 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/spawn.pyi +10 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/sysconfig.pyi +32 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/text_file.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/unixccompiler.pyi +3 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/util.pyi +53 -0
- package/bundle/_internal/mypy/typeshed/stdlib/distutils/version.pyi +36 -0
- package/bundle/_internal/mypy/typeshed/stdlib/doctest.pyi +265 -0
- package/bundle/_internal/mypy/typeshed/stdlib/email/__init__.pyi +68 -0
- package/bundle/_internal/mypy/typeshed/stdlib/email/_header_value_parser.pyi +415 -0
- package/bundle/_internal/mypy/typeshed/stdlib/email/_policybase.pyi +80 -0
- package/bundle/_internal/mypy/typeshed/stdlib/email/base64mime.pyi +13 -0
- package/bundle/_internal/mypy/typeshed/stdlib/email/charset.pyi +44 -0
- package/bundle/_internal/mypy/typeshed/stdlib/email/contentmanager.pyi +11 -0
- package/bundle/_internal/mypy/typeshed/stdlib/email/encoders.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/email/errors.pyi +38 -0
- package/bundle/_internal/mypy/typeshed/stdlib/email/feedparser.pyi +24 -0
- package/bundle/_internal/mypy/typeshed/stdlib/email/generator.pyi +79 -0
- package/bundle/_internal/mypy/typeshed/stdlib/email/header.pyi +32 -0
- package/bundle/_internal/mypy/typeshed/stdlib/email/headerregistry.pyi +196 -0
- package/bundle/_internal/mypy/typeshed/stdlib/email/iterators.pyi +15 -0
- package/bundle/_internal/mypy/typeshed/stdlib/email/message.pyi +191 -0
- package/bundle/_internal/mypy/typeshed/stdlib/email/mime/__init__.pyi +0 -0
- package/bundle/_internal/mypy/typeshed/stdlib/email/mime/application.pyi +17 -0
- package/bundle/_internal/mypy/typeshed/stdlib/email/mime/audio.pyi +17 -0
- package/bundle/_internal/mypy/typeshed/stdlib/email/mime/base.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/email/mime/image.pyi +17 -0
- package/bundle/_internal/mypy/typeshed/stdlib/email/mime/message.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/email/mime/multipart.pyi +18 -0
- package/bundle/_internal/mypy/typeshed/stdlib/email/mime/nonmultipart.pyi +5 -0
- package/bundle/_internal/mypy/typeshed/stdlib/email/mime/text.pyi +9 -0
- package/bundle/_internal/mypy/typeshed/stdlib/email/parser.pyi +42 -0
- package/bundle/_internal/mypy/typeshed/stdlib/email/policy.pyi +78 -0
- package/bundle/_internal/mypy/typeshed/stdlib/email/quoprimime.pyi +28 -0
- package/bundle/_internal/mypy/typeshed/stdlib/email/utils.pyi +72 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/__init__.pyi +15 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/aliases.pyi +1 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/ascii.pyi +30 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/base64_codec.pyi +26 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/big5.pyi +23 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/big5hkscs.pyi +23 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/bz2_codec.pyi +26 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/charmap.pyi +33 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp037.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1006.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1026.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1125.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1140.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1250.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1251.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1252.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1253.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1254.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1255.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1256.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1257.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1258.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp273.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp424.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp437.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp500.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp720.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp737.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp775.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp850.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp852.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp855.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp856.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp857.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp858.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp860.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp861.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp862.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp863.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp864.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp865.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp866.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp869.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp874.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp875.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp932.pyi +23 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp949.pyi +23 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp950.pyi +23 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/euc_jis_2004.pyi +23 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/euc_jisx0213.pyi +23 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/euc_jp.pyi +23 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/euc_kr.pyi +23 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/gb18030.pyi +23 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/gb2312.pyi +23 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/gbk.pyi +23 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/hex_codec.pyi +26 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/hp_roman8.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/hz.pyi +23 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/idna.pyi +26 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso2022_jp.pyi +23 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso2022_jp_1.pyi +23 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso2022_jp_2.pyi +23 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso2022_jp_2004.pyi +23 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso2022_jp_3.pyi +23 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso2022_jp_ext.pyi +23 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso2022_kr.pyi +23 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_1.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_10.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_11.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_13.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_14.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_15.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_16.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_2.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_3.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_4.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_5.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_6.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_7.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_8.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_9.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/johab.pyi +23 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/koi8_r.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/koi8_t.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/koi8_u.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/kz1048.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/latin_1.pyi +30 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/mac_arabic.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/mac_croatian.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/mac_cyrillic.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/mac_farsi.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/mac_greek.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/mac_iceland.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/mac_latin2.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/mac_roman.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/mac_romanian.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/mac_turkish.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/mbcs.pyi +28 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/oem.pyi +28 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/palmos.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/ptcp154.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/punycode.pyi +33 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/quopri_codec.pyi +26 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/raw_unicode_escape.pyi +23 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/rot_13.pyi +23 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/shift_jis.pyi +23 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/shift_jis_2004.pyi +23 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/shift_jisx0213.pyi +23 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/tis_620.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/undefined.pyi +20 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/unicode_escape.pyi +23 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/utf_16.pyi +20 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/utf_16_be.pyi +26 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/utf_16_le.pyi +26 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/utf_32.pyi +20 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/utf_32_be.pyi +26 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/utf_32_le.pyi +26 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/utf_7.pyi +26 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/utf_8.pyi +26 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/utf_8_sig.pyi +22 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/uu_codec.pyi +28 -0
- package/bundle/_internal/mypy/typeshed/stdlib/encodings/zlib_codec.pyi +26 -0
- package/bundle/_internal/mypy/typeshed/stdlib/ensurepip/__init__.pyi +12 -0
- package/bundle/_internal/mypy/typeshed/stdlib/enum.pyi +374 -0
- package/bundle/_internal/mypy/typeshed/stdlib/errno.pyi +227 -0
- package/bundle/_internal/mypy/typeshed/stdlib/faulthandler.pyi +61 -0
- package/bundle/_internal/mypy/typeshed/stdlib/fcntl.pyi +157 -0
- package/bundle/_internal/mypy/typeshed/stdlib/filecmp.pyi +65 -0
- package/bundle/_internal/mypy/typeshed/stdlib/fileinput.pyi +141 -0
- package/bundle/_internal/mypy/typeshed/stdlib/fnmatch.pyi +16 -0
- package/bundle/_internal/mypy/typeshed/stdlib/fractions.pyi +185 -0
- package/bundle/_internal/mypy/typeshed/stdlib/ftplib.pyi +174 -0
- package/bundle/_internal/mypy/typeshed/stdlib/functools.pyi +287 -0
- package/bundle/_internal/mypy/typeshed/stdlib/gc.pyi +32 -0
- package/bundle/_internal/mypy/typeshed/stdlib/genericpath.pyi +98 -0
- package/bundle/_internal/mypy/typeshed/stdlib/getopt.pyi +27 -0
- package/bundle/_internal/mypy/typeshed/stdlib/getpass.pyi +14 -0
- package/bundle/_internal/mypy/typeshed/stdlib/gettext.pyi +190 -0
- package/bundle/_internal/mypy/typeshed/stdlib/glob.pyi +50 -0
- package/bundle/_internal/mypy/typeshed/stdlib/graphlib.pyi +29 -0
- package/bundle/_internal/mypy/typeshed/stdlib/grp.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/gzip.pyi +181 -0
- package/bundle/_internal/mypy/typeshed/stdlib/hashlib.pyi +112 -0
- package/bundle/_internal/mypy/typeshed/stdlib/heapq.pyi +32 -0
- package/bundle/_internal/mypy/typeshed/stdlib/hmac.pyi +33 -0
- package/bundle/_internal/mypy/typeshed/stdlib/html/__init__.pyi +7 -0
- package/bundle/_internal/mypy/typeshed/stdlib/html/entities.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/html/parser.pyi +40 -0
- package/bundle/_internal/mypy/typeshed/stdlib/http/__init__.pyi +118 -0
- package/bundle/_internal/mypy/typeshed/stdlib/http/client.pyi +318 -0
- package/bundle/_internal/mypy/typeshed/stdlib/http/cookiejar.pyi +158 -0
- package/bundle/_internal/mypy/typeshed/stdlib/http/cookies.pyi +57 -0
- package/bundle/_internal/mypy/typeshed/stdlib/http/server.pyi +139 -0
- package/bundle/_internal/mypy/typeshed/stdlib/imaplib.pyi +212 -0
- package/bundle/_internal/mypy/typeshed/stdlib/imghdr.pyi +18 -0
- package/bundle/_internal/mypy/typeshed/stdlib/imp.pyi +63 -0
- package/bundle/_internal/mypy/typeshed/stdlib/importlib/__init__.pyi +17 -0
- package/bundle/_internal/mypy/typeshed/stdlib/importlib/_abc.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/importlib/_bootstrap.pyi +2 -0
- package/bundle/_internal/mypy/typeshed/stdlib/importlib/_bootstrap_external.pyi +2 -0
- package/bundle/_internal/mypy/typeshed/stdlib/importlib/abc.pyi +165 -0
- package/bundle/_internal/mypy/typeshed/stdlib/importlib/machinery.pyi +43 -0
- package/bundle/_internal/mypy/typeshed/stdlib/importlib/metadata/__init__.pyi +310 -0
- package/bundle/_internal/mypy/typeshed/stdlib/importlib/metadata/_meta.pyi +65 -0
- package/bundle/_internal/mypy/typeshed/stdlib/importlib/metadata/diagnose.pyi +2 -0
- package/bundle/_internal/mypy/typeshed/stdlib/importlib/readers.pyi +69 -0
- package/bundle/_internal/mypy/typeshed/stdlib/importlib/resources/__init__.pyi +81 -0
- package/bundle/_internal/mypy/typeshed/stdlib/importlib/resources/_common.pyi +48 -0
- package/bundle/_internal/mypy/typeshed/stdlib/importlib/resources/_functional.pyi +35 -0
- package/bundle/_internal/mypy/typeshed/stdlib/importlib/resources/abc.pyi +64 -0
- package/bundle/_internal/mypy/typeshed/stdlib/importlib/resources/readers.pyi +14 -0
- package/bundle/_internal/mypy/typeshed/stdlib/importlib/resources/simple.pyi +59 -0
- package/bundle/_internal/mypy/typeshed/stdlib/importlib/simple.pyi +11 -0
- package/bundle/_internal/mypy/typeshed/stdlib/importlib/util.pyi +75 -0
- package/bundle/_internal/mypy/typeshed/stdlib/inspect.pyi +749 -0
- package/bundle/_internal/mypy/typeshed/stdlib/io.pyi +75 -0
- package/bundle/_internal/mypy/typeshed/stdlib/ipaddress.pyi +249 -0
- package/bundle/_internal/mypy/typeshed/stdlib/itertools.pyi +376 -0
- package/bundle/_internal/mypy/typeshed/stdlib/json/__init__.pyi +93 -0
- package/bundle/_internal/mypy/typeshed/stdlib/json/decoder.pyi +50 -0
- package/bundle/_internal/mypy/typeshed/stdlib/json/encoder.pyi +40 -0
- package/bundle/_internal/mypy/typeshed/stdlib/json/scanner.pyi +7 -0
- package/bundle/_internal/mypy/typeshed/stdlib/json/tool.pyi +1 -0
- package/bundle/_internal/mypy/typeshed/stdlib/keyword.pyi +16 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/__init__.pyi +0 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/btm_matcher.pyi +28 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixer_base.pyi +42 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/__init__.pyi +0 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_apply.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_asserts.pyi +10 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_basestring.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_buffer.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_dict.pyi +16 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_except.pyi +14 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_exec.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_execfile.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_exitfunc.pyi +13 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_filter.pyi +9 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_funcattrs.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_future.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_getcwdu.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_has_key.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_idioms.pyi +15 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_import.pyi +16 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_imports.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_imports2.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_input.pyi +11 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_intern.pyi +9 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_isinstance.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_itertools.pyi +9 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_itertools_imports.pyi +7 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_long.pyi +7 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_map.pyi +9 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_metaclass.pyi +17 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_methodattrs.pyi +10 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_ne.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_next.pyi +19 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_nonzero.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_numliterals.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_operator.pyi +12 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_paren.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_print.pyi +12 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_raise.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_raw_input.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_reduce.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_reload.pyi +9 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_renames.pyi +17 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_repr.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_set_literal.pyi +7 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_standarderror.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_sys_exc.pyi +9 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_throw.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_tuple_params.pyi +16 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_types.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_unicode.pyi +12 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_urllib.pyi +15 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_ws_comma.pyi +12 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_xrange.pyi +20 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_xreadlines.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_zip.pyi +9 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/main.pyi +42 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/pgen2/__init__.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/pgen2/driver.pyi +27 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/pgen2/grammar.pyi +25 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/pgen2/literals.pyi +7 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/pgen2/parse.pyi +30 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/pgen2/pgen.pyi +53 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/pgen2/token.pyi +69 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/pgen2/tokenize.pyi +96 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/pygram.pyi +114 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/pytree.pyi +118 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/refactor.pyi +86 -0
- package/bundle/_internal/mypy/typeshed/stdlib/linecache.pyi +18 -0
- package/bundle/_internal/mypy/typeshed/stdlib/locale.pyi +160 -0
- package/bundle/_internal/mypy/typeshed/stdlib/logging/__init__.pyi +674 -0
- package/bundle/_internal/mypy/typeshed/stdlib/logging/config.pyi +141 -0
- package/bundle/_internal/mypy/typeshed/stdlib/logging/handlers.pyi +258 -0
- package/bundle/_internal/mypy/typeshed/stdlib/lzma.pyi +181 -0
- package/bundle/_internal/mypy/typeshed/stdlib/mailbox.pyi +307 -0
- package/bundle/_internal/mypy/typeshed/stdlib/mailcap.pyi +11 -0
- package/bundle/_internal/mypy/typeshed/stdlib/marshal.pyi +51 -0
- package/bundle/_internal/mypy/typeshed/stdlib/math/__init__.pyi +157 -0
- package/bundle/_internal/mypy/typeshed/stdlib/math/integer.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/mimetypes.pyi +56 -0
- package/bundle/_internal/mypy/typeshed/stdlib/mmap.pyi +191 -0
- package/bundle/_internal/mypy/typeshed/stdlib/modulefinder.pyi +68 -0
- package/bundle/_internal/mypy/typeshed/stdlib/msilib/__init__.pyi +177 -0
- package/bundle/_internal/mypy/typeshed/stdlib/msilib/schema.pyi +95 -0
- package/bundle/_internal/mypy/typeshed/stdlib/msilib/sequence.pyi +13 -0
- package/bundle/_internal/mypy/typeshed/stdlib/msilib/text.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/msvcrt.pyi +31 -0
- package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/__init__.pyi +90 -0
- package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/connection.pyi +97 -0
- package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/context.pyi +220 -0
- package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/dummy/__init__.pyi +89 -0
- package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/dummy/connection.pyi +39 -0
- package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/forkserver.pyi +78 -0
- package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/heap.pyi +41 -0
- package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/managers.pyi +390 -0
- package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/pool.pyi +101 -0
- package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/popen_fork.pyi +26 -0
- package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/popen_forkserver.pyi +16 -0
- package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/popen_spawn_posix.pyi +20 -0
- package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/popen_spawn_win32.pyi +30 -0
- package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/process.pyi +57 -0
- package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/queues.pyi +46 -0
- package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/reduction.pyi +95 -0
- package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/resource_sharer.pyi +20 -0
- package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/resource_tracker.pyi +21 -0
- package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/shared_memory.pyi +43 -0
- package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/sharedctypes.pyi +140 -0
- package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/spawn.pyi +32 -0
- package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/synchronize.pyi +63 -0
- package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/util.pyi +109 -0
- package/bundle/_internal/mypy/typeshed/stdlib/netrc.pyi +23 -0
- package/bundle/_internal/mypy/typeshed/stdlib/nis.pyi +9 -0
- package/bundle/_internal/mypy/typeshed/stdlib/nntplib.pyi +120 -0
- package/bundle/_internal/mypy/typeshed/stdlib/nt.pyi +116 -0
- package/bundle/_internal/mypy/typeshed/stdlib/ntpath.pyi +134 -0
- package/bundle/_internal/mypy/typeshed/stdlib/nturl2path.pyi +6 -0
- package/bundle/_internal/mypy/typeshed/stdlib/numbers.pyi +220 -0
- package/bundle/_internal/mypy/typeshed/stdlib/opcode.pyi +53 -0
- package/bundle/_internal/mypy/typeshed/stdlib/operator.pyi +219 -0
- package/bundle/_internal/mypy/typeshed/stdlib/optparse.pyi +312 -0
- package/bundle/_internal/mypy/typeshed/stdlib/os/__init__.pyi +1878 -0
- package/bundle/_internal/mypy/typeshed/stdlib/os/path.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/ossaudiodev.pyi +132 -0
- package/bundle/_internal/mypy/typeshed/stdlib/pathlib/__init__.pyi +358 -0
- package/bundle/_internal/mypy/typeshed/stdlib/pathlib/types.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/pdb.pyi +275 -0
- package/bundle/_internal/mypy/typeshed/stdlib/pickle.pyi +240 -0
- package/bundle/_internal/mypy/typeshed/stdlib/pickletools.pyi +176 -0
- package/bundle/_internal/mypy/typeshed/stdlib/pipes.pyi +16 -0
- package/bundle/_internal/mypy/typeshed/stdlib/pkgutil.pyi +60 -0
- package/bundle/_internal/mypy/typeshed/stdlib/platform.pyi +100 -0
- package/bundle/_internal/mypy/typeshed/stdlib/plistlib.pyi +84 -0
- package/bundle/_internal/mypy/typeshed/stdlib/poplib.pyi +93 -0
- package/bundle/_internal/mypy/typeshed/stdlib/posix.pyi +427 -0
- package/bundle/_internal/mypy/typeshed/stdlib/posixpath.pyi +230 -0
- package/bundle/_internal/mypy/typeshed/stdlib/pprint.pyi +170 -0
- package/bundle/_internal/mypy/typeshed/stdlib/profile.pyi +31 -0
- package/bundle/_internal/mypy/typeshed/stdlib/profiling/__init__.pyi +3 -0
- package/bundle/_internal/mypy/typeshed/stdlib/profiling/sampling/__init__.pyi +17 -0
- package/bundle/_internal/mypy/typeshed/stdlib/profiling/sampling/collector.pyi +25 -0
- package/bundle/_internal/mypy/typeshed/stdlib/profiling/sampling/gecko_collector.pyi +111 -0
- package/bundle/_internal/mypy/typeshed/stdlib/profiling/sampling/heatmap_collector.pyi +24 -0
- package/bundle/_internal/mypy/typeshed/stdlib/profiling/sampling/jsonl_collector.pyi +15 -0
- package/bundle/_internal/mypy/typeshed/stdlib/profiling/sampling/pstats_collector.pyi +17 -0
- package/bundle/_internal/mypy/typeshed/stdlib/profiling/sampling/stack_collector.pyi +40 -0
- package/bundle/_internal/mypy/typeshed/stdlib/profiling/sampling/string_table.pyi +5 -0
- package/bundle/_internal/mypy/typeshed/stdlib/profiling/tracing.pyi +9 -0
- package/bundle/_internal/mypy/typeshed/stdlib/pstats.pyi +96 -0
- package/bundle/_internal/mypy/typeshed/stdlib/pty.pyi +24 -0
- package/bundle/_internal/mypy/typeshed/stdlib/pwd.pyi +27 -0
- package/bundle/_internal/mypy/typeshed/stdlib/py_compile.pyi +28 -0
- package/bundle/_internal/mypy/typeshed/stdlib/pyclbr.pyi +57 -0
- package/bundle/_internal/mypy/typeshed/stdlib/pydoc.pyi +348 -0
- package/bundle/_internal/mypy/typeshed/stdlib/pydoc_data/__init__.pyi +0 -0
- package/bundle/_internal/mypy/typeshed/stdlib/pydoc_data/module_docs.pyi +3 -0
- package/bundle/_internal/mypy/typeshed/stdlib/pydoc_data/topics.pyi +3 -0
- package/bundle/_internal/mypy/typeshed/stdlib/pyexpat/__init__.pyi +88 -0
- package/bundle/_internal/mypy/typeshed/stdlib/pyexpat/errors.pyi +53 -0
- package/bundle/_internal/mypy/typeshed/stdlib/pyexpat/model.pyi +13 -0
- package/bundle/_internal/mypy/typeshed/stdlib/queue.pyi +55 -0
- package/bundle/_internal/mypy/typeshed/stdlib/quopri.pyi +12 -0
- package/bundle/_internal/mypy/typeshed/stdlib/random.pyi +135 -0
- package/bundle/_internal/mypy/typeshed/stdlib/re.pyi +347 -0
- package/bundle/_internal/mypy/typeshed/stdlib/readline.pyi +39 -0
- package/bundle/_internal/mypy/typeshed/stdlib/reprlib.pyi +64 -0
- package/bundle/_internal/mypy/typeshed/stdlib/resource.pyi +102 -0
- package/bundle/_internal/mypy/typeshed/stdlib/rlcompleter.pyi +9 -0
- package/bundle/_internal/mypy/typeshed/stdlib/runpy.pyi +24 -0
- package/bundle/_internal/mypy/typeshed/stdlib/sched.pyi +34 -0
- package/bundle/_internal/mypy/typeshed/stdlib/secrets.pyi +17 -0
- package/bundle/_internal/mypy/typeshed/stdlib/select.pyi +171 -0
- package/bundle/_internal/mypy/typeshed/stdlib/selectors.pyi +67 -0
- package/bundle/_internal/mypy/typeshed/stdlib/shelve.pyi +110 -0
- package/bundle/_internal/mypy/typeshed/stdlib/shlex.pyi +63 -0
- package/bundle/_internal/mypy/typeshed/stdlib/shutil.pyi +243 -0
- package/bundle/_internal/mypy/typeshed/stdlib/signal.pyi +174 -0
- package/bundle/_internal/mypy/typeshed/stdlib/site.pyi +46 -0
- package/bundle/_internal/mypy/typeshed/stdlib/smtpd.pyi +92 -0
- package/bundle/_internal/mypy/typeshed/stdlib/smtplib.pyi +223 -0
- package/bundle/_internal/mypy/typeshed/stdlib/sndhdr.pyi +14 -0
- package/bundle/_internal/mypy/typeshed/stdlib/socket.pyi +1587 -0
- package/bundle/_internal/mypy/typeshed/stdlib/socketserver.pyi +170 -0
- package/bundle/_internal/mypy/typeshed/stdlib/spwd.pyi +45 -0
- package/bundle/_internal/mypy/typeshed/stdlib/sqlite3/__init__.pyi +510 -0
- package/bundle/_internal/mypy/typeshed/stdlib/sqlite3/dbapi2.pyi +244 -0
- package/bundle/_internal/mypy/typeshed/stdlib/sqlite3/dump.pyi +2 -0
- package/bundle/_internal/mypy/typeshed/stdlib/sre_compile.pyi +12 -0
- package/bundle/_internal/mypy/typeshed/stdlib/sre_constants.pyi +135 -0
- package/bundle/_internal/mypy/typeshed/stdlib/sre_parse.pyi +102 -0
- package/bundle/_internal/mypy/typeshed/stdlib/ssl.pyi +540 -0
- package/bundle/_internal/mypy/typeshed/stdlib/stat.pyi +126 -0
- package/bundle/_internal/mypy/typeshed/stdlib/statistics.pyi +161 -0
- package/bundle/_internal/mypy/typeshed/stdlib/string/__init__.pyi +81 -0
- package/bundle/_internal/mypy/typeshed/stdlib/string/templatelib.pyi +36 -0
- package/bundle/_internal/mypy/typeshed/stdlib/stringprep.pyi +29 -0
- package/bundle/_internal/mypy/typeshed/stdlib/struct.pyi +5 -0
- package/bundle/_internal/mypy/typeshed/stdlib/subprocess.pyi +1484 -0
- package/bundle/_internal/mypy/typeshed/stdlib/sunau.pyi +82 -0
- package/bundle/_internal/mypy/typeshed/stdlib/symtable.pyi +95 -0
- package/bundle/_internal/mypy/typeshed/stdlib/sys/__init__.pyi +538 -0
- package/bundle/_internal/mypy/typeshed/stdlib/sys/__jit.pyi +11 -0
- package/bundle/_internal/mypy/typeshed/stdlib/sys/_monitoring.pyi +69 -0
- package/bundle/_internal/mypy/typeshed/stdlib/sysconfig.pyi +59 -0
- package/bundle/_internal/mypy/typeshed/stdlib/syslog.pyi +58 -0
- package/bundle/_internal/mypy/typeshed/stdlib/tabnanny.pyi +16 -0
- package/bundle/_internal/mypy/typeshed/stdlib/tarfile.pyi +868 -0
- package/bundle/_internal/mypy/typeshed/stdlib/telnetlib.pyi +123 -0
- package/bundle/_internal/mypy/typeshed/stdlib/tempfile.pyi +474 -0
- package/bundle/_internal/mypy/typeshed/stdlib/termios.pyi +303 -0
- package/bundle/_internal/mypy/typeshed/stdlib/textwrap.pyi +103 -0
- package/bundle/_internal/mypy/typeshed/stdlib/this.pyi +2 -0
- package/bundle/_internal/mypy/typeshed/stdlib/threading.pyi +221 -0
- package/bundle/_internal/mypy/typeshed/stdlib/time.pyi +117 -0
- package/bundle/_internal/mypy/typeshed/stdlib/timeit.pyi +46 -0
- package/bundle/_internal/mypy/typeshed/stdlib/tkinter/__init__.pyi +4376 -0
- package/bundle/_internal/mypy/typeshed/stdlib/tkinter/colorchooser.pyi +12 -0
- package/bundle/_internal/mypy/typeshed/stdlib/tkinter/commondialog.pyi +14 -0
- package/bundle/_internal/mypy/typeshed/stdlib/tkinter/constants.pyi +80 -0
- package/bundle/_internal/mypy/typeshed/stdlib/tkinter/dialog.pyi +13 -0
- package/bundle/_internal/mypy/typeshed/stdlib/tkinter/dnd.pyi +19 -0
- package/bundle/_internal/mypy/typeshed/stdlib/tkinter/filedialog.pyi +149 -0
- package/bundle/_internal/mypy/typeshed/stdlib/tkinter/font.pyi +123 -0
- package/bundle/_internal/mypy/typeshed/stdlib/tkinter/messagebox.pyi +98 -0
- package/bundle/_internal/mypy/typeshed/stdlib/tkinter/scrolledtext.pyi +9 -0
- package/bundle/_internal/mypy/typeshed/stdlib/tkinter/simpledialog.pyi +58 -0
- package/bundle/_internal/mypy/typeshed/stdlib/tkinter/tix.pyi +299 -0
- package/bundle/_internal/mypy/typeshed/stdlib/tkinter/ttk.pyi +1434 -0
- package/bundle/_internal/mypy/typeshed/stdlib/token.pyi +166 -0
- package/bundle/_internal/mypy/typeshed/stdlib/tokenize.pyi +201 -0
- package/bundle/_internal/mypy/typeshed/stdlib/tomllib.pyi +27 -0
- package/bundle/_internal/mypy/typeshed/stdlib/trace.pyi +85 -0
- package/bundle/_internal/mypy/typeshed/stdlib/traceback.pyi +293 -0
- package/bundle/_internal/mypy/typeshed/stdlib/tracemalloc.pyi +123 -0
- package/bundle/_internal/mypy/typeshed/stdlib/tty.pyi +29 -0
- package/bundle/_internal/mypy/typeshed/stdlib/turtle.pyi +856 -0
- package/bundle/_internal/mypy/typeshed/stdlib/types.pyi +744 -0
- package/bundle/_internal/mypy/typeshed/stdlib/typing.pyi +1250 -0
- package/bundle/_internal/mypy/typeshed/stdlib/typing_extensions.pyi +749 -0
- package/bundle/_internal/mypy/typeshed/stdlib/unicodedata.pyi +94 -0
- package/bundle/_internal/mypy/typeshed/stdlib/unittest/__init__.pyi +63 -0
- package/bundle/_internal/mypy/typeshed/stdlib/unittest/_log.pyi +29 -0
- package/bundle/_internal/mypy/typeshed/stdlib/unittest/async_case.pyi +24 -0
- package/bundle/_internal/mypy/typeshed/stdlib/unittest/case.pyi +352 -0
- package/bundle/_internal/mypy/typeshed/stdlib/unittest/loader.pyi +55 -0
- package/bundle/_internal/mypy/typeshed/stdlib/unittest/main.pyi +74 -0
- package/bundle/_internal/mypy/typeshed/stdlib/unittest/mock.pyi +555 -0
- package/bundle/_internal/mypy/typeshed/stdlib/unittest/result.pyi +46 -0
- package/bundle/_internal/mypy/typeshed/stdlib/unittest/runner.pyi +93 -0
- package/bundle/_internal/mypy/typeshed/stdlib/unittest/signals.pyi +15 -0
- package/bundle/_internal/mypy/typeshed/stdlib/unittest/suite.pyi +23 -0
- package/bundle/_internal/mypy/typeshed/stdlib/unittest/util.pyi +39 -0
- package/bundle/_internal/mypy/typeshed/stdlib/urllib/__init__.pyi +0 -0
- package/bundle/_internal/mypy/typeshed/stdlib/urllib/error.pyi +29 -0
- package/bundle/_internal/mypy/typeshed/stdlib/urllib/parse.pyi +354 -0
- package/bundle/_internal/mypy/typeshed/stdlib/urllib/request.pyi +447 -0
- package/bundle/_internal/mypy/typeshed/stdlib/urllib/response.pyi +45 -0
- package/bundle/_internal/mypy/typeshed/stdlib/urllib/robotparser.pyi +20 -0
- package/bundle/_internal/mypy/typeshed/stdlib/uu.pyi +12 -0
- package/bundle/_internal/mypy/typeshed/stdlib/uuid.pyi +106 -0
- package/bundle/_internal/mypy/typeshed/stdlib/venv/__init__.pyi +86 -0
- package/bundle/_internal/mypy/typeshed/stdlib/warnings.pyi +146 -0
- package/bundle/_internal/mypy/typeshed/stdlib/wave.pyi +105 -0
- package/bundle/_internal/mypy/typeshed/stdlib/weakref.pyi +217 -0
- package/bundle/_internal/mypy/typeshed/stdlib/webbrowser.pyi +93 -0
- package/bundle/_internal/mypy/typeshed/stdlib/winreg.pyi +137 -0
- package/bundle/_internal/mypy/typeshed/stdlib/winsound.pyi +40 -0
- package/bundle/_internal/mypy/typeshed/stdlib/wsgiref/__init__.pyi +0 -0
- package/bundle/_internal/mypy/typeshed/stdlib/wsgiref/handlers.pyi +91 -0
- package/bundle/_internal/mypy/typeshed/stdlib/wsgiref/headers.pyi +27 -0
- package/bundle/_internal/mypy/typeshed/stdlib/wsgiref/simple_server.pyi +37 -0
- package/bundle/_internal/mypy/typeshed/stdlib/wsgiref/types.pyi +31 -0
- package/bundle/_internal/mypy/typeshed/stdlib/wsgiref/util.pyi +26 -0
- package/bundle/_internal/mypy/typeshed/stdlib/wsgiref/validate.pyi +50 -0
- package/bundle/_internal/mypy/typeshed/stdlib/xdrlib.pyi +57 -0
- package/bundle/_internal/mypy/typeshed/stdlib/xml/__init__.pyi +9 -0
- package/bundle/_internal/mypy/typeshed/stdlib/xml/dom/NodeFilter.pyi +22 -0
- package/bundle/_internal/mypy/typeshed/stdlib/xml/dom/__init__.pyi +101 -0
- package/bundle/_internal/mypy/typeshed/stdlib/xml/dom/domreg.pyi +8 -0
- package/bundle/_internal/mypy/typeshed/stdlib/xml/dom/expatbuilder.pyi +126 -0
- package/bundle/_internal/mypy/typeshed/stdlib/xml/dom/minicompat.pyi +24 -0
- package/bundle/_internal/mypy/typeshed/stdlib/xml/dom/minidom.pyi +693 -0
- package/bundle/_internal/mypy/typeshed/stdlib/xml/dom/pulldom.pyi +109 -0
- package/bundle/_internal/mypy/typeshed/stdlib/xml/dom/xmlbuilder.pyi +82 -0
- package/bundle/_internal/mypy/typeshed/stdlib/xml/etree/ElementInclude.pyi +28 -0
- package/bundle/_internal/mypy/typeshed/stdlib/xml/etree/ElementPath.pyi +42 -0
- package/bundle/_internal/mypy/typeshed/stdlib/xml/etree/ElementTree.pyi +402 -0
- package/bundle/_internal/mypy/typeshed/stdlib/xml/etree/__init__.pyi +0 -0
- package/bundle/_internal/mypy/typeshed/stdlib/xml/etree/cElementTree.pyi +1 -0
- package/bundle/_internal/mypy/typeshed/stdlib/xml/parsers/__init__.pyi +1 -0
- package/bundle/_internal/mypy/typeshed/stdlib/xml/parsers/expat/__init__.pyi +7 -0
- package/bundle/_internal/mypy/typeshed/stdlib/xml/parsers/expat/errors.pyi +1 -0
- package/bundle/_internal/mypy/typeshed/stdlib/xml/parsers/expat/model.pyi +1 -0
- package/bundle/_internal/mypy/typeshed/stdlib/xml/sax/__init__.pyi +42 -0
- package/bundle/_internal/mypy/typeshed/stdlib/xml/sax/_exceptions.pyi +19 -0
- package/bundle/_internal/mypy/typeshed/stdlib/xml/sax/expatreader.pyi +72 -0
- package/bundle/_internal/mypy/typeshed/stdlib/xml/sax/handler.pyi +85 -0
- package/bundle/_internal/mypy/typeshed/stdlib/xml/sax/saxutils.pyi +69 -0
- package/bundle/_internal/mypy/typeshed/stdlib/xml/sax/xmlreader.pyi +94 -0
- package/bundle/_internal/mypy/typeshed/stdlib/xml/utils.pyi +2 -0
- package/bundle/_internal/mypy/typeshed/stdlib/xmlrpc/__init__.pyi +0 -0
- package/bundle/_internal/mypy/typeshed/stdlib/xmlrpc/client.pyi +300 -0
- package/bundle/_internal/mypy/typeshed/stdlib/xmlrpc/server.pyi +149 -0
- package/bundle/_internal/mypy/typeshed/stdlib/xxlimited.pyi +15 -0
- package/bundle/_internal/mypy/typeshed/stdlib/zipapp.pyi +19 -0
- package/bundle/_internal/mypy/typeshed/stdlib/zipfile/__init__.pyi +411 -0
- package/bundle/_internal/mypy/typeshed/stdlib/zipfile/_path/__init__.pyi +87 -0
- package/bundle/_internal/mypy/typeshed/stdlib/zipfile/_path/glob.pyi +26 -0
- package/bundle/_internal/mypy/typeshed/stdlib/zipimport.pyi +44 -0
- package/bundle/_internal/mypy/typeshed/stdlib/zlib.pyi +81 -0
- package/bundle/_internal/mypy/typeshed/stdlib/zoneinfo/__init__.pyi +36 -0
- package/bundle/_internal/mypy/typeshed/stdlib/zoneinfo/_common.pyi +14 -0
- package/bundle/_internal/mypy/typeshed/stdlib/zoneinfo/_tzpath.pyi +13 -0
- package/bundle/_internal/mypy/typeshed/stubs/librt/librt/__init__.pyi +0 -0
- package/bundle/_internal/mypy/typeshed/stubs/librt/librt/base64.pyi +4 -0
- package/bundle/_internal/mypy/typeshed/stubs/librt/librt/internal.pyi +22 -0
- package/bundle/_internal/mypy/typeshed/stubs/librt/librt/random.pyi +22 -0
- package/bundle/_internal/mypy/typeshed/stubs/librt/librt/strings.pyi +61 -0
- package/bundle/_internal/mypy/typeshed/stubs/librt/librt/threading.pyi +16 -0
- package/bundle/_internal/mypy/typeshed/stubs/librt/librt/time.pyi +1 -0
- package/bundle/_internal/mypy/typeshed/stubs/librt/librt/vecs.pyi +24 -0
- package/bundle/_internal/mypy/typeshed/stubs/mypy-extensions/mypy_extensions.pyi +226 -0
- package/bundle/_internal/mypy/typestate.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/typestate.py +334 -0
- package/bundle/_internal/mypy/typetraverser.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/typetraverser.py +166 -0
- package/bundle/_internal/mypy/typevars.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/typevars.py +84 -0
- package/bundle/_internal/mypy/typevartuples.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/typevartuples.py +36 -0
- package/bundle/_internal/mypy/util.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/util.py +1055 -0
- package/bundle/_internal/mypy/version.py +1 -0
- package/bundle/_internal/mypy/visitor.cpython-312-darwin.so +0 -0
- package/bundle/_internal/mypy/visitor.py +639 -0
- package/bundle/_internal/mypy/xml/mypy-html.css +104 -0
- package/bundle/_internal/mypy/xml/mypy-html.xslt +81 -0
- package/bundle/_internal/mypy/xml/mypy-txt.xslt +100 -0
- package/bundle/_internal/mypy/xml/mypy.xsd +50 -0
- package/bundle/_internal/mypy-2.4.1.dist-info/INSTALLER +1 -0
- package/bundle/_internal/mypy-2.4.1.dist-info/METADATA +56 -0
- package/bundle/_internal/mypy-2.4.1.dist-info/RECORD +1814 -0
- package/bundle/_internal/mypy-2.4.1.dist-info/WHEEL +6 -0
- package/bundle/_internal/mypy-2.4.1.dist-info/entry_points.txt +6 -0
- package/bundle/_internal/mypy-2.4.1.dist-info/licenses/LICENSE +264 -0
- package/bundle/_internal/mypy-2.4.1.dist-info/licenses/mypy/typeshed/LICENSE +237 -0
- package/bundle/_internal/mypy-2.4.1.dist-info/top_level.txt +3 -0
- package/bundle/_internal/mypyc/__init__.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_asyncio.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_bisect.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_blake2.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_bz2.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_codecs_cn.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_codecs_hk.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_codecs_iso2022.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_codecs_jp.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_codecs_kr.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_codecs_tw.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_contextvars.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_csv.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_ctypes.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_curses.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_datetime.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_decimal.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_elementtree.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_hashlib.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_heapq.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_json.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_lzma.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_md5.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_multibytecodec.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_multiprocessing.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_opcode.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_pickle.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_posixshmem.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_posixsubprocess.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_queue.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_random.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_scproxy.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_sha1.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_sha2.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_sha3.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_socket.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_sqlite3.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_ssl.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_statistics.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_struct.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/_uuid.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/array.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/binascii.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/fcntl.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/grp.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/math.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/mmap.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/pyexpat.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/readline.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/resource.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/select.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/syslog.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/termios.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/unicodedata.cpython-312-darwin.so +0 -0
- package/bundle/_internal/python3.12/lib-dynload/zlib.cpython-312-darwin.so +0 -0
- package/bundle/_internal/radon/__init__.py +21 -0
- package/bundle/_internal/radon/__main__.py +4 -0
- package/bundle/_internal/radon/cli/__init__.py +433 -0
- package/bundle/_internal/radon/cli/colors.py +49 -0
- package/bundle/_internal/radon/cli/harvest.py +449 -0
- package/bundle/_internal/radon/cli/tools.py +597 -0
- package/bundle/_internal/radon/complexity.py +108 -0
- package/bundle/_internal/radon/contrib/__init__.py +0 -0
- package/bundle/_internal/radon/contrib/flake8.py +72 -0
- package/bundle/_internal/radon/metrics.py +157 -0
- package/bundle/_internal/radon/raw.py +245 -0
- package/bundle/_internal/radon/tests/__init__.py +0 -0
- package/bundle/_internal/radon/tests/conftest.py +31 -0
- package/bundle/_internal/radon/tests/data/__init__.py +5 -0
- package/bundle/_internal/radon/tests/data/no_encoding.py +2 -0
- package/bundle/_internal/radon/tests/data/py3unicode.py +5 -0
- package/bundle/_internal/radon/tests/run.py +14 -0
- package/bundle/_internal/radon/tests/test_cli.py +282 -0
- package/bundle/_internal/radon/tests/test_cli_colors.py +22 -0
- package/bundle/_internal/radon/tests/test_cli_harvest.py +392 -0
- package/bundle/_internal/radon/tests/test_cli_tools.py +616 -0
- package/bundle/_internal/radon/tests/test_complexity_utils.py +118 -0
- package/bundle/_internal/radon/tests/test_complexity_visitor.py +754 -0
- package/bundle/_internal/radon/tests/test_halstead.py +113 -0
- package/bundle/_internal/radon/tests/test_ipynb.py +141 -0
- package/bundle/_internal/radon/tests/test_other_metrics.py +169 -0
- package/bundle/_internal/radon/tests/test_raw.py +467 -0
- package/bundle/_internal/radon/visitors.py +460 -0
- package/bundle/_internal/radon-6.0.1.dist-info/INSTALLER +1 -0
- package/bundle/_internal/radon-6.0.1.dist-info/LICENSE +22 -0
- package/bundle/_internal/radon-6.0.1.dist-info/METADATA +263 -0
- package/bundle/_internal/radon-6.0.1.dist-info/RECORD +64 -0
- package/bundle/_internal/radon-6.0.1.dist-info/WHEEL +6 -0
- package/bundle/_internal/radon-6.0.1.dist-info/entry_points.txt +8 -0
- package/bundle/_internal/radon-6.0.1.dist-info/top_level.txt +1 -0
- package/bundle/_internal/setuptools/_vendor/jaraco/text/Lorem ipsum.txt +2 -0
- package/bundle/_internal/stevedore-5.10.0.dist-info/INSTALLER +1 -0
- package/bundle/_internal/stevedore-5.10.0.dist-info/METADATA +56 -0
- package/bundle/_internal/stevedore-5.10.0.dist-info/RECORD +84 -0
- package/bundle/_internal/stevedore-5.10.0.dist-info/WHEEL +5 -0
- package/bundle/_internal/stevedore-5.10.0.dist-info/entry_points.txt +10 -0
- package/bundle/_internal/stevedore-5.10.0.dist-info/licenses/AUTHORS +76 -0
- package/bundle/_internal/stevedore-5.10.0.dist-info/licenses/LICENSE +202 -0
- package/bundle/_internal/stevedore-5.10.0.dist-info/pbr.json +1 -0
- package/bundle/_internal/stevedore-5.10.0.dist-info/top_level.txt +1 -0
- package/bundle/_internal/tqdm-4.70.1.dist-info/INSTALLER +1 -0
- package/bundle/_internal/tqdm-4.70.1.dist-info/METADATA +1600 -0
- package/bundle/_internal/tqdm-4.70.1.dist-info/RECORD +72 -0
- package/bundle/_internal/tqdm-4.70.1.dist-info/WHEEL +5 -0
- package/bundle/_internal/tqdm-4.70.1.dist-info/entry_points.txt +2 -0
- package/bundle/_internal/tqdm-4.70.1.dist-info/licenses/LICENCE +49 -0
- package/bundle/_internal/tqdm-4.70.1.dist-info/top_level.txt +1 -0
- package/bundle/_internal/yaml/_yaml.cpython-312-darwin.so +0 -0
- package/bundle/gnost +0 -0
- package/package.json +10 -7
|
@@ -0,0 +1,1355 @@
|
|
|
1
|
+
"""Miscellaneous type operations and helpers for use during type checking.
|
|
2
|
+
|
|
3
|
+
NOTE: These must not be accessed from mypy.nodes or mypy.types to avoid import
|
|
4
|
+
cycles. These must not be called from the semantic analysis main pass
|
|
5
|
+
since these may assume that MROs are ready.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import itertools
|
|
11
|
+
from collections.abc import Callable, Iterable, Sequence
|
|
12
|
+
from typing import Any, TypeVar, cast
|
|
13
|
+
|
|
14
|
+
from mypy.checker_state import checker_state
|
|
15
|
+
from mypy.copytype import copy_type
|
|
16
|
+
from mypy.expandtype import expand_type, expand_type_by_instance
|
|
17
|
+
from mypy.lookup import lookup_stdlib_typeinfo
|
|
18
|
+
from mypy.maptype import map_instance_to_supertype
|
|
19
|
+
from mypy.modules_state import modules_state
|
|
20
|
+
from mypy.nodes import (
|
|
21
|
+
ARG_POS,
|
|
22
|
+
ARG_STAR,
|
|
23
|
+
ARG_STAR2,
|
|
24
|
+
SYMBOL_FUNCBASE_TYPES,
|
|
25
|
+
Decorator,
|
|
26
|
+
Expression,
|
|
27
|
+
FuncBase,
|
|
28
|
+
FuncDef,
|
|
29
|
+
FuncItem,
|
|
30
|
+
OverloadedFuncDef,
|
|
31
|
+
StrExpr,
|
|
32
|
+
SymbolNode,
|
|
33
|
+
TypeInfo,
|
|
34
|
+
Var,
|
|
35
|
+
)
|
|
36
|
+
from mypy.state import state
|
|
37
|
+
from mypy.types import (
|
|
38
|
+
ELLIPSIS_TYPE_NAMES,
|
|
39
|
+
NOT_IMPLEMENTED_TYPE_NAMES,
|
|
40
|
+
SENTINEL_TYPE_NAMES,
|
|
41
|
+
AnyType,
|
|
42
|
+
CallableType,
|
|
43
|
+
ExtraAttrs,
|
|
44
|
+
FormalArgument,
|
|
45
|
+
FunctionLike,
|
|
46
|
+
Instance,
|
|
47
|
+
LiteralType,
|
|
48
|
+
NoneType,
|
|
49
|
+
NormalizedCallableType,
|
|
50
|
+
Overloaded,
|
|
51
|
+
Parameters,
|
|
52
|
+
ParamSpecType,
|
|
53
|
+
PartialType,
|
|
54
|
+
ProperType,
|
|
55
|
+
TupleType,
|
|
56
|
+
Type,
|
|
57
|
+
TypeAliasType,
|
|
58
|
+
TypedDictType,
|
|
59
|
+
TypeOfAny,
|
|
60
|
+
TypeQuery,
|
|
61
|
+
TypeType,
|
|
62
|
+
TypeVarLikeType,
|
|
63
|
+
TypeVarTupleType,
|
|
64
|
+
TypeVarType,
|
|
65
|
+
UninhabitedType,
|
|
66
|
+
UnionType,
|
|
67
|
+
UnpackType,
|
|
68
|
+
flatten_nested_unions,
|
|
69
|
+
get_proper_type,
|
|
70
|
+
get_proper_types,
|
|
71
|
+
instance_cache,
|
|
72
|
+
remove_dups,
|
|
73
|
+
)
|
|
74
|
+
from mypy.typetraverser import TypeTraverserVisitor
|
|
75
|
+
from mypy.typevars import fill_typevars
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def is_recursive_pair(s: Type, t: Type) -> bool:
|
|
79
|
+
"""Is this a pair of recursive types?
|
|
80
|
+
|
|
81
|
+
There may be more cases, and we may be forced to use e.g. has_recursive_types()
|
|
82
|
+
here, but this function is called in very hot code, so we try to keep it simple
|
|
83
|
+
and return True only in cases we know may have problems.
|
|
84
|
+
"""
|
|
85
|
+
if isinstance(s, TypeAliasType) and s.is_recursive:
|
|
86
|
+
return (
|
|
87
|
+
isinstance(get_proper_type(t), (Instance, UnionType))
|
|
88
|
+
or isinstance(t, TypeAliasType)
|
|
89
|
+
and t.is_recursive
|
|
90
|
+
# Tuple types are special, they can cause an infinite recursion even if
|
|
91
|
+
# the other type is not recursive, because of the tuple fallback that is
|
|
92
|
+
# calculated "on the fly".
|
|
93
|
+
or isinstance(get_proper_type(s), TupleType)
|
|
94
|
+
)
|
|
95
|
+
if isinstance(t, TypeAliasType) and t.is_recursive:
|
|
96
|
+
return (
|
|
97
|
+
isinstance(get_proper_type(s), (Instance, UnionType))
|
|
98
|
+
or isinstance(s, TypeAliasType)
|
|
99
|
+
and s.is_recursive
|
|
100
|
+
# Same as above.
|
|
101
|
+
or isinstance(get_proper_type(t), TupleType)
|
|
102
|
+
)
|
|
103
|
+
return False
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def tuple_fallback(typ: TupleType) -> Instance:
|
|
107
|
+
"""Return fallback type for a tuple."""
|
|
108
|
+
info = typ.partial_fallback.type
|
|
109
|
+
if info.fullname != "builtins.tuple":
|
|
110
|
+
return typ.partial_fallback
|
|
111
|
+
items = []
|
|
112
|
+
for item in typ.items:
|
|
113
|
+
if isinstance(item, UnpackType):
|
|
114
|
+
unpacked_type = get_proper_type(item.type)
|
|
115
|
+
if isinstance(unpacked_type, TypeVarTupleType):
|
|
116
|
+
unpacked_type = get_proper_type(unpacked_type.upper_bound)
|
|
117
|
+
if (
|
|
118
|
+
isinstance(unpacked_type, Instance)
|
|
119
|
+
and unpacked_type.type.fullname == "builtins.tuple"
|
|
120
|
+
):
|
|
121
|
+
items.append(unpacked_type.args[0])
|
|
122
|
+
else:
|
|
123
|
+
raise NotImplementedError
|
|
124
|
+
else:
|
|
125
|
+
items.append(item)
|
|
126
|
+
return Instance(
|
|
127
|
+
info,
|
|
128
|
+
# Note: flattening recursive unions is dangerous, since it can fool recursive
|
|
129
|
+
# types optimization in subtypes.py and go into infinite recursion.
|
|
130
|
+
[make_simplified_union(items, handle_recursive=False)],
|
|
131
|
+
extra_attrs=typ.partial_fallback.extra_attrs,
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
def get_self_type(func: CallableType, def_info: TypeInfo) -> Type | None:
|
|
136
|
+
default_self = fill_typevars(def_info)
|
|
137
|
+
if isinstance(get_proper_type(func.ret_type), UninhabitedType):
|
|
138
|
+
return func.ret_type
|
|
139
|
+
elif func.arg_types and func.arg_types[0] != default_self and func.arg_kinds[0] == ARG_POS:
|
|
140
|
+
return func.arg_types[0]
|
|
141
|
+
else:
|
|
142
|
+
return None
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
def type_object_type(
|
|
146
|
+
info: TypeInfo, named_type: Callable[[str], Instance] | None = None
|
|
147
|
+
) -> ProperType:
|
|
148
|
+
"""Return the type of a type object.
|
|
149
|
+
|
|
150
|
+
For a generic type G with type variables T and S the type is generally of form
|
|
151
|
+
|
|
152
|
+
Callable[..., G[T, S]]
|
|
153
|
+
|
|
154
|
+
where ... are argument types for the __init__/__new__ method (without the self
|
|
155
|
+
argument). Also, the fallback type will be 'type' instead of 'function'.
|
|
156
|
+
Note: we keep the unused `named_type` argument to avoid breaking plugins.
|
|
157
|
+
"""
|
|
158
|
+
allow_cache = (
|
|
159
|
+
checker_state.type_checker is not None
|
|
160
|
+
and checker_state.type_checker.allow_constructor_cache
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
if info.type_object_type is not None:
|
|
164
|
+
if allow_cache:
|
|
165
|
+
return info.type_object_type
|
|
166
|
+
info.type_object_type = None
|
|
167
|
+
|
|
168
|
+
# We take the type from whichever of __init__ and __new__ is first
|
|
169
|
+
# in the MRO, preferring __init__ if there is a tie.
|
|
170
|
+
init_method = info.get("__init__")
|
|
171
|
+
new_method = info.get("__new__")
|
|
172
|
+
if not init_method or not is_valid_constructor(init_method.node):
|
|
173
|
+
# Must be an invalid class definition.
|
|
174
|
+
return AnyType(TypeOfAny.from_error)
|
|
175
|
+
# There *should* always be a __new__ method except the test stubs
|
|
176
|
+
# lack it, so just copy init_method in that situation
|
|
177
|
+
new_method = new_method or init_method
|
|
178
|
+
if not is_valid_constructor(new_method.node):
|
|
179
|
+
# Must be an invalid class definition.
|
|
180
|
+
return AnyType(TypeOfAny.from_error)
|
|
181
|
+
|
|
182
|
+
# The two is_valid_constructor() checks ensure this.
|
|
183
|
+
assert isinstance(new_method.node, (SYMBOL_FUNCBASE_TYPES, Decorator))
|
|
184
|
+
assert isinstance(init_method.node, (SYMBOL_FUNCBASE_TYPES, Decorator))
|
|
185
|
+
|
|
186
|
+
init_index = info.mro.index(init_method.node.info)
|
|
187
|
+
new_index = info.mro.index(new_method.node.info)
|
|
188
|
+
|
|
189
|
+
if info.metaclass_type is not None:
|
|
190
|
+
fallback = info.metaclass_type
|
|
191
|
+
else:
|
|
192
|
+
type_type = lookup_stdlib_typeinfo("builtins.type", modules_state.modules)
|
|
193
|
+
fallback = Instance(type_type, [])
|
|
194
|
+
|
|
195
|
+
if init_index < new_index:
|
|
196
|
+
method: FuncBase | Decorator = init_method.node
|
|
197
|
+
is_new = False
|
|
198
|
+
elif init_index > new_index:
|
|
199
|
+
method = new_method.node
|
|
200
|
+
is_new = True
|
|
201
|
+
else:
|
|
202
|
+
if init_method.node.info.fullname == "builtins.object":
|
|
203
|
+
# Both are defined by object. But if we've got a bogus
|
|
204
|
+
# base class, we can't know for sure, so check for that.
|
|
205
|
+
if info.fallback_to_any:
|
|
206
|
+
# Construct a universal callable as the prototype.
|
|
207
|
+
any_type = AnyType(TypeOfAny.special_form)
|
|
208
|
+
if instance_cache.function_type is None:
|
|
209
|
+
function_typeinfo = lookup_stdlib_typeinfo(
|
|
210
|
+
"builtins.function", modules_state.modules
|
|
211
|
+
)
|
|
212
|
+
instance_cache.function_type = Instance(function_typeinfo, [])
|
|
213
|
+
sig = CallableType(
|
|
214
|
+
arg_types=[any_type, any_type],
|
|
215
|
+
arg_kinds=[ARG_STAR, ARG_STAR2],
|
|
216
|
+
arg_names=["_args", "_kwds"],
|
|
217
|
+
ret_type=any_type,
|
|
218
|
+
is_bound=True,
|
|
219
|
+
fallback=instance_cache.function_type,
|
|
220
|
+
)
|
|
221
|
+
result: FunctionLike = class_callable(
|
|
222
|
+
sig, info, None, fallback, None, is_new=False
|
|
223
|
+
)
|
|
224
|
+
if allow_cache and state.strict_optional:
|
|
225
|
+
info.type_object_type = result
|
|
226
|
+
return result
|
|
227
|
+
|
|
228
|
+
# Otherwise prefer __init__ in a tie. It isn't clear that this
|
|
229
|
+
# is the right thing, but __new__ caused problems with
|
|
230
|
+
# typeshed (#5647).
|
|
231
|
+
method = init_method.node
|
|
232
|
+
is_new = False
|
|
233
|
+
# Construct callable type based on signature of __init__. Adjust
|
|
234
|
+
# return type and insert type arguments.
|
|
235
|
+
if isinstance(method, FuncBase):
|
|
236
|
+
if isinstance(method, OverloadedFuncDef) and not method.type:
|
|
237
|
+
# Do not cache if the type is not ready. Same logic for decorators is
|
|
238
|
+
# achieved in early return above because is_valid_constructor() is False.
|
|
239
|
+
allow_cache = False
|
|
240
|
+
t = function_type(method, fallback)
|
|
241
|
+
else:
|
|
242
|
+
assert isinstance(method.type, ProperType)
|
|
243
|
+
assert isinstance(method.type, FunctionLike) # is_valid_constructor() ensures this
|
|
244
|
+
t = method.type
|
|
245
|
+
result = type_object_type_from_function(t, info, method.info, fallback, is_new)
|
|
246
|
+
# Tuple constructor in typeshed is imprecise (and precise one is impossible to express),
|
|
247
|
+
# so we special-case constructors for tuple types. Note we skip the tuple class itself
|
|
248
|
+
# as a micro-optimization, since it is unlikely one would write tuple((1, 2)).
|
|
249
|
+
if method.info.fullname == "builtins.tuple" and info.fullname != "builtins.tuple":
|
|
250
|
+
assert isinstance(result, CallableType)
|
|
251
|
+
result = result.copy_modified(special_sig="tuple")
|
|
252
|
+
# Only write cached result is strict_optional=True, otherwise we may get
|
|
253
|
+
# inconsistent behaviour because of union simplification.
|
|
254
|
+
if allow_cache and state.strict_optional:
|
|
255
|
+
info.type_object_type = result
|
|
256
|
+
return result
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
def is_valid_constructor(n: SymbolNode | None) -> bool:
|
|
260
|
+
"""Does this node represents a valid constructor method?
|
|
261
|
+
|
|
262
|
+
This includes normal functions, overloaded functions, and decorators
|
|
263
|
+
that return a callable type.
|
|
264
|
+
"""
|
|
265
|
+
if isinstance(n, SYMBOL_FUNCBASE_TYPES):
|
|
266
|
+
return True
|
|
267
|
+
if isinstance(n, Decorator):
|
|
268
|
+
return isinstance(get_proper_type(n.type), FunctionLike)
|
|
269
|
+
return False
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
def type_object_type_from_function(
|
|
273
|
+
signature: FunctionLike, info: TypeInfo, def_info: TypeInfo, fallback: Instance, is_new: bool
|
|
274
|
+
) -> FunctionLike:
|
|
275
|
+
# We first need to record all non-trivial (explicit) self types in __init__,
|
|
276
|
+
# since they will not be available after we bind them. Note, we use explicit
|
|
277
|
+
# self-types only in the defining class, similar to __new__ (but not exactly the same,
|
|
278
|
+
# see comment in class_callable below). This is mostly useful for annotating library
|
|
279
|
+
# classes such as subprocess.Popen.
|
|
280
|
+
if not is_new and not info.is_newtype:
|
|
281
|
+
orig_self_types = [get_self_type(it, def_info) for it in signature.items]
|
|
282
|
+
else:
|
|
283
|
+
orig_self_types = [None] * len(signature.items)
|
|
284
|
+
|
|
285
|
+
# The __init__ method might come from a generic superclass 'def_info'
|
|
286
|
+
# with type variables that do not map identically to the type variables of
|
|
287
|
+
# the class 'info' being constructed. For example:
|
|
288
|
+
#
|
|
289
|
+
# class A(Generic[T]):
|
|
290
|
+
# def __init__(self, x: T) -> None: ...
|
|
291
|
+
# class B(A[List[T]]):
|
|
292
|
+
# ...
|
|
293
|
+
#
|
|
294
|
+
# We need to map B's __init__ to the type (List[T]) -> None.
|
|
295
|
+
signature = bind_self(
|
|
296
|
+
signature,
|
|
297
|
+
original_type=fill_typevars(info),
|
|
298
|
+
is_classmethod=is_new,
|
|
299
|
+
# Explicit instance self annotations have special handling in class_callable(),
|
|
300
|
+
# we don't need to bind any type variables in them if they are generic.
|
|
301
|
+
ignore_instances=True,
|
|
302
|
+
)
|
|
303
|
+
signature = cast(FunctionLike, map_type_from_supertype(signature, info, def_info))
|
|
304
|
+
|
|
305
|
+
special_sig: str | None = None
|
|
306
|
+
if def_info.fullname == "builtins.dict":
|
|
307
|
+
# Special signature!
|
|
308
|
+
special_sig = "dict"
|
|
309
|
+
|
|
310
|
+
if isinstance(signature, CallableType):
|
|
311
|
+
return class_callable(
|
|
312
|
+
signature, info, def_info, fallback, special_sig, is_new, orig_self_types[0]
|
|
313
|
+
)
|
|
314
|
+
else:
|
|
315
|
+
# Overloaded __init__/__new__.
|
|
316
|
+
assert isinstance(signature, Overloaded)
|
|
317
|
+
items: list[CallableType] = []
|
|
318
|
+
for item, orig_self in zip(signature.items, orig_self_types):
|
|
319
|
+
items.append(
|
|
320
|
+
class_callable(item, info, def_info, fallback, special_sig, is_new, orig_self)
|
|
321
|
+
)
|
|
322
|
+
return Overloaded(items)
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
def class_callable(
|
|
326
|
+
init_type: CallableType,
|
|
327
|
+
info: TypeInfo,
|
|
328
|
+
def_info: TypeInfo | None,
|
|
329
|
+
type_type: Instance,
|
|
330
|
+
special_sig: str | None,
|
|
331
|
+
is_new: bool,
|
|
332
|
+
orig_self_type: Type | None = None,
|
|
333
|
+
) -> CallableType:
|
|
334
|
+
"""Create a type object type based on the signature of __init__."""
|
|
335
|
+
variables: list[TypeVarLikeType] = []
|
|
336
|
+
variables.extend(info.defn.type_vars)
|
|
337
|
+
variables.extend(init_type.variables)
|
|
338
|
+
|
|
339
|
+
from mypy.subtypes import is_equivalent, is_subtype
|
|
340
|
+
|
|
341
|
+
init_ret_type = get_proper_type(init_type.ret_type)
|
|
342
|
+
orig_self_type = get_proper_type(orig_self_type)
|
|
343
|
+
default_ret_type = fill_typevars(info)
|
|
344
|
+
# Default return type in the class where constructor method was defined.
|
|
345
|
+
default_def_ret_type = fill_typevars(def_info) if def_info is not None else default_ret_type
|
|
346
|
+
explicit_type = init_ret_type if is_new else orig_self_type
|
|
347
|
+
if (
|
|
348
|
+
is_new
|
|
349
|
+
and explicit_type is not None
|
|
350
|
+
# We used to only use the explicit return type of __new__() when it was a subtype
|
|
351
|
+
# of the current class. As a result, we may now have a situation like this:
|
|
352
|
+
# class C:
|
|
353
|
+
# def __new__(cls) -> C: ...
|
|
354
|
+
# class D(C): ...
|
|
355
|
+
# So we need to ignore the explicit annotation when creating constructor type for D.
|
|
356
|
+
and (
|
|
357
|
+
isinstance(explicit_type, AnyType)
|
|
358
|
+
and explicit_type.type_of_any != TypeOfAny.unannotated
|
|
359
|
+
or not is_equivalent(default_def_ret_type, explicit_type, ignore_type_params=True)
|
|
360
|
+
)
|
|
361
|
+
):
|
|
362
|
+
ret_type = explicit_type
|
|
363
|
+
elif (
|
|
364
|
+
isinstance(explicit_type, (Instance, TupleType, UninhabitedType, LiteralType))
|
|
365
|
+
# We have to skip protocols, because it can be a subtype of a return type
|
|
366
|
+
# by accident. Like `Hashable` is a subtype of `object`. See #11799
|
|
367
|
+
and isinstance(default_ret_type, Instance)
|
|
368
|
+
and not default_ret_type.type.is_protocol
|
|
369
|
+
# Use the declared self in __init__ if it is a subtype of what we would use otherwise.
|
|
370
|
+
and is_subtype(explicit_type, default_ret_type, ignore_type_params=True)
|
|
371
|
+
):
|
|
372
|
+
ret_type = explicit_type
|
|
373
|
+
else:
|
|
374
|
+
ret_type = default_ret_type
|
|
375
|
+
|
|
376
|
+
return init_type.copy_modified(
|
|
377
|
+
ret_type=ret_type,
|
|
378
|
+
fallback=type_type,
|
|
379
|
+
name=info.name,
|
|
380
|
+
variables=variables,
|
|
381
|
+
special_sig=special_sig,
|
|
382
|
+
instance_type=default_ret_type,
|
|
383
|
+
)
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
def map_type_from_supertype(typ: Type, sub_info: TypeInfo, super_info: TypeInfo) -> Type:
|
|
387
|
+
"""Map type variables in a type defined in a supertype context to be valid
|
|
388
|
+
in the subtype context. Assume that the result is unique; if more than
|
|
389
|
+
one type is possible, return one of the alternatives.
|
|
390
|
+
|
|
391
|
+
For example, assume
|
|
392
|
+
|
|
393
|
+
class D(Generic[S]): ...
|
|
394
|
+
class C(D[E[T]], Generic[T]): ...
|
|
395
|
+
|
|
396
|
+
Now S in the context of D would be mapped to E[T] in the context of C.
|
|
397
|
+
"""
|
|
398
|
+
# Create the type of self in subtype, of form t[a1, ...].
|
|
399
|
+
inst_type = fill_typevars(sub_info)
|
|
400
|
+
if isinstance(inst_type, TupleType):
|
|
401
|
+
inst_type = tuple_fallback(inst_type)
|
|
402
|
+
# Map the type of self to supertype. This gets us a description of the
|
|
403
|
+
# supertype type variables in terms of subtype variables, i.e. t[t1, ...]
|
|
404
|
+
# so that any type variables in tN are to be interpreted in subtype
|
|
405
|
+
# context.
|
|
406
|
+
inst_type = map_instance_to_supertype(inst_type, super_info)
|
|
407
|
+
# Finally expand the type variables in type with those in the previously
|
|
408
|
+
# constructed type. Note that both type and inst_type may have type
|
|
409
|
+
# variables, but in type they are interpreted in supertype context while
|
|
410
|
+
# in inst_type they are interpreted in subtype context. This works even if
|
|
411
|
+
# the names of type variables in supertype and subtype overlap.
|
|
412
|
+
return expand_type_by_instance(typ, inst_type)
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
def supported_self_type(
|
|
416
|
+
typ: ProperType, allow_callable: bool = True, allow_instances: bool = True
|
|
417
|
+
) -> bool:
|
|
418
|
+
"""Is this a supported kind of explicit self-types?
|
|
419
|
+
|
|
420
|
+
Currently, this means an X or Type[X], where X is an instance or
|
|
421
|
+
a type variable with an instance upper bound.
|
|
422
|
+
"""
|
|
423
|
+
if isinstance(typ, TypeType):
|
|
424
|
+
return supported_self_type(typ.item)
|
|
425
|
+
if allow_callable and isinstance(typ, CallableType):
|
|
426
|
+
# Special case: allow class callable instead of Type[...] as cls annotation,
|
|
427
|
+
# as well as callable self for callback protocols.
|
|
428
|
+
return True
|
|
429
|
+
return isinstance(typ, TypeVarType) or (
|
|
430
|
+
allow_instances and isinstance(typ, Instance) and typ != fill_typevars(typ.type)
|
|
431
|
+
)
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
F = TypeVar("F", bound=FunctionLike)
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
def bind_self(
|
|
438
|
+
method: F,
|
|
439
|
+
original_type: Type | None = None,
|
|
440
|
+
is_classmethod: bool = False,
|
|
441
|
+
ignore_instances: bool = False,
|
|
442
|
+
) -> F:
|
|
443
|
+
"""Return a copy of `method`, with the type of its first parameter (usually
|
|
444
|
+
self or cls) bound to original_type.
|
|
445
|
+
|
|
446
|
+
If the type of `self` is a generic type (T, or Type[T] for classmethods),
|
|
447
|
+
instantiate every occurrence of type with original_type in the rest of the
|
|
448
|
+
signature and in the return type.
|
|
449
|
+
|
|
450
|
+
original_type is the type of E in the expression E.copy(). It is None in
|
|
451
|
+
compatibility checks. In this case we treat it as the erasure of the
|
|
452
|
+
declared type of self.
|
|
453
|
+
|
|
454
|
+
This way we can express "the type of self". For example:
|
|
455
|
+
|
|
456
|
+
T = TypeVar('T', bound='A')
|
|
457
|
+
class A:
|
|
458
|
+
def copy(self: T) -> T: ...
|
|
459
|
+
|
|
460
|
+
class B(A): pass
|
|
461
|
+
|
|
462
|
+
b = B().copy() # type: B
|
|
463
|
+
|
|
464
|
+
"""
|
|
465
|
+
if isinstance(method, Overloaded):
|
|
466
|
+
items = [
|
|
467
|
+
bind_self(c, original_type, is_classmethod, ignore_instances) for c in method.items
|
|
468
|
+
]
|
|
469
|
+
return cast(F, Overloaded(items))
|
|
470
|
+
assert isinstance(method, CallableType)
|
|
471
|
+
func: CallableType = method
|
|
472
|
+
if not func.arg_types:
|
|
473
|
+
# Invalid method, return something.
|
|
474
|
+
return method
|
|
475
|
+
if func.arg_kinds[0] in (ARG_STAR, ARG_STAR2):
|
|
476
|
+
# The signature is of the form 'def foo(*args, ...)'.
|
|
477
|
+
# In this case we shouldn't drop the first arg,
|
|
478
|
+
# since func will be absorbed by the *args.
|
|
479
|
+
# TODO: infer bounds on the type of *args?
|
|
480
|
+
|
|
481
|
+
# In the case of **kwargs we should probably emit an error, but
|
|
482
|
+
# for now we simply skip it, to avoid crashes down the line.
|
|
483
|
+
return method
|
|
484
|
+
self_param_type = get_proper_type(func.arg_types[0])
|
|
485
|
+
|
|
486
|
+
variables: Sequence[TypeVarLikeType]
|
|
487
|
+
# Having a def __call__(self: Callable[...], ...) can cause infinite recursion. Although
|
|
488
|
+
# this special-casing looks not very principled, there is nothing meaningful we can infer
|
|
489
|
+
# from such definition, since it is inherently indefinitely recursive.
|
|
490
|
+
allow_callable = func.name is None or not func.name.startswith("__call__ of")
|
|
491
|
+
if func.variables and supported_self_type(
|
|
492
|
+
self_param_type, allow_callable=allow_callable, allow_instances=not ignore_instances
|
|
493
|
+
):
|
|
494
|
+
from mypy.infer import infer_type_arguments
|
|
495
|
+
|
|
496
|
+
if original_type is None:
|
|
497
|
+
# TODO: type check method override (see #7861).
|
|
498
|
+
original_type = erase_to_bound(self_param_type)
|
|
499
|
+
original_type = get_proper_type(original_type)
|
|
500
|
+
|
|
501
|
+
# Find which of method type variables appear in the type of "self".
|
|
502
|
+
self_ids = {tv.id for tv in get_all_type_vars(self_param_type)}
|
|
503
|
+
self_vars = [tv for tv in func.variables if tv.id in self_ids]
|
|
504
|
+
|
|
505
|
+
# Solve for these type arguments using the actual class or instance type.
|
|
506
|
+
typeargs = infer_type_arguments(
|
|
507
|
+
self_vars, self_param_type, original_type, is_supertype=True, erase_types=False
|
|
508
|
+
)
|
|
509
|
+
if (
|
|
510
|
+
is_classmethod
|
|
511
|
+
and any(isinstance(get_proper_type(t), UninhabitedType) for t in typeargs)
|
|
512
|
+
and isinstance(original_type, (Instance, TypeVarType, TupleType))
|
|
513
|
+
):
|
|
514
|
+
# In case we call a classmethod through an instance x, fallback to type(x).
|
|
515
|
+
typeargs = infer_type_arguments(
|
|
516
|
+
self_vars,
|
|
517
|
+
self_param_type,
|
|
518
|
+
TypeType(original_type),
|
|
519
|
+
is_supertype=True,
|
|
520
|
+
erase_types=False,
|
|
521
|
+
)
|
|
522
|
+
|
|
523
|
+
# Update the method signature with the solutions found.
|
|
524
|
+
# Technically, some constraints might be unsolvable, make them Never.
|
|
525
|
+
to_apply = [t if t is not None else UninhabitedType() for t in typeargs]
|
|
526
|
+
func = expand_type(func, {tv.id: arg for tv, arg in zip(self_vars, to_apply)})
|
|
527
|
+
variables = [v for v in func.variables if v not in self_vars]
|
|
528
|
+
else:
|
|
529
|
+
variables = func.variables
|
|
530
|
+
|
|
531
|
+
res = func.copy_modified(
|
|
532
|
+
arg_types=func.arg_types[1:],
|
|
533
|
+
arg_kinds=func.arg_kinds[1:],
|
|
534
|
+
arg_names=func.arg_names[1:],
|
|
535
|
+
variables=variables,
|
|
536
|
+
is_bound=True,
|
|
537
|
+
)
|
|
538
|
+
return cast(F, res)
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
def erase_to_bound(t: Type) -> Type:
|
|
542
|
+
# TODO: use value restrictions to produce a union?
|
|
543
|
+
t = get_proper_type(t)
|
|
544
|
+
if isinstance(t, TypeVarType):
|
|
545
|
+
return t.upper_bound
|
|
546
|
+
if isinstance(t, TypeType):
|
|
547
|
+
if isinstance(t.item, TypeVarType):
|
|
548
|
+
return TypeType.make_normalized(t.item.upper_bound, is_type_form=t.is_type_form)
|
|
549
|
+
return t
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
def callable_corresponding_argument(
|
|
553
|
+
typ: NormalizedCallableType | Parameters, model: FormalArgument
|
|
554
|
+
) -> FormalArgument | None:
|
|
555
|
+
"""Return the argument of a function that corresponds to `model`"""
|
|
556
|
+
|
|
557
|
+
by_name = typ.argument_by_name(model.name)
|
|
558
|
+
by_pos = typ.argument_by_position(model.pos)
|
|
559
|
+
if by_name is None and by_pos is None:
|
|
560
|
+
return None
|
|
561
|
+
if by_name is not None and by_pos is not None:
|
|
562
|
+
if by_name == by_pos:
|
|
563
|
+
return by_name
|
|
564
|
+
# If we're dealing with an optional pos-only and an optional
|
|
565
|
+
# name-only arg, merge them. This is the case for all functions
|
|
566
|
+
# taking both *args and **args, or a pair of functions like so:
|
|
567
|
+
|
|
568
|
+
# def right(a: int = ...) -> None: ...
|
|
569
|
+
# def left(x: int = ..., /, *, a: int = ...) -> None: ...
|
|
570
|
+
from mypy.meet import meet_types
|
|
571
|
+
|
|
572
|
+
if (
|
|
573
|
+
not (by_name.required or by_pos.required)
|
|
574
|
+
and by_pos.name is None
|
|
575
|
+
and by_name.pos is None
|
|
576
|
+
# This is not principled, but prevents a crash. It's weird to have a FormalArgument
|
|
577
|
+
# that has an UnpackType.
|
|
578
|
+
and not isinstance(by_name.typ, UnpackType)
|
|
579
|
+
and not isinstance(by_pos.typ, UnpackType)
|
|
580
|
+
):
|
|
581
|
+
return FormalArgument(
|
|
582
|
+
by_name.name, by_pos.pos, meet_types(by_name.typ, by_pos.typ), False
|
|
583
|
+
)
|
|
584
|
+
return by_name
|
|
585
|
+
|
|
586
|
+
return by_name if by_name is not None else by_pos
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
def simple_literal_type(t: ProperType | None) -> Instance | None:
|
|
590
|
+
"""Extract the underlying fallback Instance type for a simple Literal"""
|
|
591
|
+
if isinstance(t, Instance) and t.last_known_value is not None:
|
|
592
|
+
t = t.last_known_value
|
|
593
|
+
if isinstance(t, LiteralType):
|
|
594
|
+
return t.fallback
|
|
595
|
+
return None
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
def is_simple_literal(t: ProperType) -> bool:
|
|
599
|
+
if isinstance(t, LiteralType):
|
|
600
|
+
return t.fallback.type.is_enum or t.fallback.type.fullname == "builtins.str"
|
|
601
|
+
if isinstance(t, Instance):
|
|
602
|
+
return t.last_known_value is not None and isinstance(t.last_known_value.value, str)
|
|
603
|
+
return False
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
def make_simplified_union(
|
|
607
|
+
items: Sequence[Type],
|
|
608
|
+
line: int = -1,
|
|
609
|
+
column: int = -1,
|
|
610
|
+
*,
|
|
611
|
+
keep_erased: bool = False,
|
|
612
|
+
contract_literals: bool = True,
|
|
613
|
+
handle_recursive: bool = True,
|
|
614
|
+
) -> ProperType:
|
|
615
|
+
"""Build union type with redundant union items removed.
|
|
616
|
+
|
|
617
|
+
If only a single item remains, this may return a non-union type.
|
|
618
|
+
|
|
619
|
+
Examples:
|
|
620
|
+
|
|
621
|
+
* [int, str] -> Union[int, str]
|
|
622
|
+
* [int, object] -> object
|
|
623
|
+
* [int, int] -> int
|
|
624
|
+
* [int, Any] -> Union[int, Any] (Any types are not simplified away!)
|
|
625
|
+
* [Any, Any] -> Any
|
|
626
|
+
* [int, Union[bytes, str]] -> Union[int, bytes, str]
|
|
627
|
+
|
|
628
|
+
Note: This must NOT be used during semantic analysis, since TypeInfos may not
|
|
629
|
+
be fully initialized.
|
|
630
|
+
|
|
631
|
+
The keep_erased flag is used for type inference against union types
|
|
632
|
+
containing type variables. If set to True, keep all ErasedType items.
|
|
633
|
+
|
|
634
|
+
The contract_literals flag indicates whether we need to contract literal types
|
|
635
|
+
back into a sum type. Set it to False when called by try_expanding_sum_type_
|
|
636
|
+
to_union().
|
|
637
|
+
"""
|
|
638
|
+
# Step 1: expand all nested unions
|
|
639
|
+
items = flatten_nested_unions(items, handle_recursive=handle_recursive)
|
|
640
|
+
|
|
641
|
+
# Step 2: fast path for single item
|
|
642
|
+
if len(items) == 1:
|
|
643
|
+
return get_proper_type(items[0])
|
|
644
|
+
|
|
645
|
+
# Step 3: remove redundant unions
|
|
646
|
+
simplified_set: Sequence[Type] = _remove_redundant_union_items(items, keep_erased)
|
|
647
|
+
|
|
648
|
+
# Step 4: If more than one literal exists in the union, try to simplify
|
|
649
|
+
if (
|
|
650
|
+
contract_literals
|
|
651
|
+
and sum(isinstance(get_proper_type(item), LiteralType) for item in simplified_set) > 1
|
|
652
|
+
):
|
|
653
|
+
simplified_set = try_contracting_literals_in_union(simplified_set)
|
|
654
|
+
|
|
655
|
+
result = get_proper_type(UnionType.make_union(simplified_set, line, column))
|
|
656
|
+
|
|
657
|
+
nitems = len(items)
|
|
658
|
+
if nitems > 1 and (
|
|
659
|
+
nitems > 2 or not (type(items[0]) is NoneType or type(items[1]) is NoneType)
|
|
660
|
+
):
|
|
661
|
+
# Step 5: At last, we erase any (inconsistent) extra attributes on instances.
|
|
662
|
+
|
|
663
|
+
# Initialize with None instead of an empty set as a micro-optimization. The set
|
|
664
|
+
# is needed very rarely, so we try to avoid constructing it.
|
|
665
|
+
extra_attrs_set: set[ExtraAttrs] | None = None
|
|
666
|
+
for item in items:
|
|
667
|
+
instance = try_getting_instance_fallback(item)
|
|
668
|
+
if instance and instance.extra_attrs:
|
|
669
|
+
if extra_attrs_set is None:
|
|
670
|
+
extra_attrs_set = {instance.extra_attrs}
|
|
671
|
+
else:
|
|
672
|
+
extra_attrs_set.add(instance.extra_attrs)
|
|
673
|
+
|
|
674
|
+
# Code below is awkward, because we don't want the extra checks to affect
|
|
675
|
+
# performance in the common case.
|
|
676
|
+
erase_extra = False
|
|
677
|
+
if extra_attrs_set is not None:
|
|
678
|
+
fallback = try_getting_instance_fallback(result)
|
|
679
|
+
if fallback is None:
|
|
680
|
+
return result
|
|
681
|
+
if len(extra_attrs_set) > 1: # This case is too tricky to handle.
|
|
682
|
+
erase_extra = True
|
|
683
|
+
else:
|
|
684
|
+
# Check that all relevant items have the extra attributes.
|
|
685
|
+
for item in items:
|
|
686
|
+
instance = try_getting_instance_fallback(item)
|
|
687
|
+
if instance and instance.type == fallback.type and not instance.extra_attrs:
|
|
688
|
+
erase_extra = True
|
|
689
|
+
break
|
|
690
|
+
if erase_extra:
|
|
691
|
+
fallback.extra_attrs = None
|
|
692
|
+
|
|
693
|
+
return result
|
|
694
|
+
|
|
695
|
+
|
|
696
|
+
def _remove_redundant_union_items(items: list[Type], keep_erased: bool) -> list[Type]:
|
|
697
|
+
from mypy.subtypes import is_proper_subtype
|
|
698
|
+
|
|
699
|
+
# The first pass through this loop, we check if later items are subtypes of earlier items.
|
|
700
|
+
# The second pass through this loop, we check if earlier items are subtypes of later items
|
|
701
|
+
# (by reversing the remaining items)
|
|
702
|
+
for _direction in range(2):
|
|
703
|
+
new_items: list[Type] = []
|
|
704
|
+
# seen is a map from a type to its index in new_items
|
|
705
|
+
seen: dict[ProperType, int] = {}
|
|
706
|
+
unduplicated_literal_fallbacks: set[Instance] | None = None
|
|
707
|
+
for ti in items:
|
|
708
|
+
proper_ti = get_proper_type(ti)
|
|
709
|
+
|
|
710
|
+
# UninhabitedType is always redundant
|
|
711
|
+
if isinstance(proper_ti, UninhabitedType):
|
|
712
|
+
continue
|
|
713
|
+
|
|
714
|
+
duplicate_index = -1
|
|
715
|
+
# Quickly check if we've seen this type
|
|
716
|
+
if proper_ti in seen:
|
|
717
|
+
duplicate_index = seen[proper_ti]
|
|
718
|
+
elif (
|
|
719
|
+
isinstance(proper_ti, LiteralType)
|
|
720
|
+
and unduplicated_literal_fallbacks is not None
|
|
721
|
+
and proper_ti.fallback in unduplicated_literal_fallbacks
|
|
722
|
+
):
|
|
723
|
+
# This is an optimisation for unions with many LiteralType
|
|
724
|
+
# We've already checked for exact duplicates. This means that any super type of
|
|
725
|
+
# the LiteralType must be a super type of its fallback. If we've gone through
|
|
726
|
+
# the expensive loop below and found no super type for a previous LiteralType
|
|
727
|
+
# with the same fallback, we can skip doing that work again and just add the type
|
|
728
|
+
# to new_items
|
|
729
|
+
pass
|
|
730
|
+
else:
|
|
731
|
+
# If not, check if we've seen a supertype of this type
|
|
732
|
+
for j, tj in enumerate(new_items):
|
|
733
|
+
proper_tj = get_proper_type(tj)
|
|
734
|
+
# If tj is an Instance with a last_known_value, do not remove proper_ti
|
|
735
|
+
# (unless it's an instance with the same last_known_value)
|
|
736
|
+
if (
|
|
737
|
+
isinstance(proper_tj, Instance)
|
|
738
|
+
and proper_tj.last_known_value is not None
|
|
739
|
+
and not (
|
|
740
|
+
isinstance(proper_ti, Instance)
|
|
741
|
+
and proper_tj.last_known_value == proper_ti.last_known_value
|
|
742
|
+
)
|
|
743
|
+
):
|
|
744
|
+
continue
|
|
745
|
+
|
|
746
|
+
if is_proper_subtype(
|
|
747
|
+
ti, tj, keep_erased_types=keep_erased, ignore_promotions=True
|
|
748
|
+
):
|
|
749
|
+
duplicate_index = j
|
|
750
|
+
break
|
|
751
|
+
if duplicate_index != -1:
|
|
752
|
+
# If deleted subtypes had more general truthiness, use that
|
|
753
|
+
orig_item = new_items[duplicate_index]
|
|
754
|
+
if not orig_item.can_be_true and ti.can_be_true:
|
|
755
|
+
new_items[duplicate_index] = true_or_false(orig_item)
|
|
756
|
+
elif not orig_item.can_be_false and ti.can_be_false:
|
|
757
|
+
new_items[duplicate_index] = true_or_false(orig_item)
|
|
758
|
+
else:
|
|
759
|
+
# We have a non-duplicate item, add it to new_items
|
|
760
|
+
seen[proper_ti] = len(new_items)
|
|
761
|
+
new_items.append(ti)
|
|
762
|
+
if isinstance(proper_ti, LiteralType):
|
|
763
|
+
if unduplicated_literal_fallbacks is None:
|
|
764
|
+
unduplicated_literal_fallbacks = set()
|
|
765
|
+
unduplicated_literal_fallbacks.add(proper_ti.fallback)
|
|
766
|
+
|
|
767
|
+
items = new_items
|
|
768
|
+
if len(items) <= 1:
|
|
769
|
+
break
|
|
770
|
+
items.reverse()
|
|
771
|
+
|
|
772
|
+
return items
|
|
773
|
+
|
|
774
|
+
|
|
775
|
+
def _get_type_method_ret_type(t: ProperType, *, name: str) -> Type | None:
|
|
776
|
+
# For Enum literals the ret_type can change based on the Enum
|
|
777
|
+
# we need to check the type of the enum rather than the literal
|
|
778
|
+
if isinstance(t, LiteralType) and t.is_enum_literal():
|
|
779
|
+
t = t.fallback
|
|
780
|
+
|
|
781
|
+
if isinstance(t, Instance):
|
|
782
|
+
sym = t.type.get(name)
|
|
783
|
+
if sym:
|
|
784
|
+
sym_type = get_proper_type(sym.type)
|
|
785
|
+
if isinstance(sym_type, CallableType):
|
|
786
|
+
return sym_type.ret_type
|
|
787
|
+
|
|
788
|
+
return None
|
|
789
|
+
|
|
790
|
+
|
|
791
|
+
def true_only(t: Type) -> ProperType:
|
|
792
|
+
"""
|
|
793
|
+
Restricted version of t with only True-ish values
|
|
794
|
+
"""
|
|
795
|
+
t = get_proper_type(t)
|
|
796
|
+
|
|
797
|
+
if not t.can_be_true:
|
|
798
|
+
# All values of t are False-ish, so there are no true values in it
|
|
799
|
+
return UninhabitedType(line=t.line, column=t.column)
|
|
800
|
+
elif not t.can_be_false:
|
|
801
|
+
# All values of t are already True-ish, so true_only is idempotent in this case
|
|
802
|
+
return t
|
|
803
|
+
elif isinstance(t, UnionType):
|
|
804
|
+
# The true version of a union type is the union of the true versions of its components
|
|
805
|
+
new_items = [true_only(item) for item in t.items]
|
|
806
|
+
can_be_true_items = [item for item in new_items if item.can_be_true]
|
|
807
|
+
return make_simplified_union(can_be_true_items, line=t.line, column=t.column)
|
|
808
|
+
else:
|
|
809
|
+
ret_type = _get_type_method_ret_type(t, name="__bool__") or _get_type_method_ret_type(
|
|
810
|
+
t, name="__len__"
|
|
811
|
+
)
|
|
812
|
+
|
|
813
|
+
if ret_type and not ret_type.can_be_true:
|
|
814
|
+
return UninhabitedType(line=t.line, column=t.column)
|
|
815
|
+
|
|
816
|
+
new_t = copy_type(t)
|
|
817
|
+
new_t.can_be_false = False
|
|
818
|
+
return new_t
|
|
819
|
+
|
|
820
|
+
|
|
821
|
+
def false_only(t: Type) -> ProperType:
|
|
822
|
+
"""
|
|
823
|
+
Restricted version of t with only False-ish values
|
|
824
|
+
"""
|
|
825
|
+
t = get_proper_type(t)
|
|
826
|
+
|
|
827
|
+
if not t.can_be_false:
|
|
828
|
+
if state.strict_optional:
|
|
829
|
+
# All values of t are True-ish, so there are no false values in it
|
|
830
|
+
return UninhabitedType(line=t.line)
|
|
831
|
+
else:
|
|
832
|
+
# When strict optional checking is disabled, everything can be
|
|
833
|
+
# False-ish since anything can be None
|
|
834
|
+
return NoneType(line=t.line)
|
|
835
|
+
elif not t.can_be_true:
|
|
836
|
+
# All values of t are already False-ish, so false_only is idempotent in this case
|
|
837
|
+
return t
|
|
838
|
+
elif isinstance(t, UnionType):
|
|
839
|
+
# The false version of a union type is the union of the false versions of its components
|
|
840
|
+
new_items = [false_only(item) for item in t.items]
|
|
841
|
+
can_be_false_items = [item for item in new_items if item.can_be_false]
|
|
842
|
+
return make_simplified_union(can_be_false_items, line=t.line, column=t.column)
|
|
843
|
+
elif isinstance(t, Instance) and t.type.fullname in ("builtins.str", "builtins.bytes"):
|
|
844
|
+
return LiteralType("", fallback=t)
|
|
845
|
+
elif isinstance(t, Instance) and t.type.fullname == "builtins.int":
|
|
846
|
+
return LiteralType(0, fallback=t)
|
|
847
|
+
else:
|
|
848
|
+
ret_type = _get_type_method_ret_type(t, name="__bool__") or _get_type_method_ret_type(
|
|
849
|
+
t, name="__len__"
|
|
850
|
+
)
|
|
851
|
+
|
|
852
|
+
if ret_type:
|
|
853
|
+
if not ret_type.can_be_false:
|
|
854
|
+
return UninhabitedType(line=t.line)
|
|
855
|
+
elif isinstance(t, Instance):
|
|
856
|
+
if (t.type.is_final or t.type.is_enum) and state.strict_optional:
|
|
857
|
+
return UninhabitedType(line=t.line)
|
|
858
|
+
elif isinstance(t, LiteralType) and t.is_enum_literal() and state.strict_optional:
|
|
859
|
+
return UninhabitedType(line=t.line)
|
|
860
|
+
|
|
861
|
+
new_t = copy_type(t)
|
|
862
|
+
new_t.can_be_true = False
|
|
863
|
+
return new_t
|
|
864
|
+
|
|
865
|
+
|
|
866
|
+
def true_or_false(t: Type) -> ProperType:
|
|
867
|
+
"""
|
|
868
|
+
Unrestricted version of t with both True-ish and False-ish values
|
|
869
|
+
"""
|
|
870
|
+
t = get_proper_type(t)
|
|
871
|
+
|
|
872
|
+
if isinstance(t, UnionType):
|
|
873
|
+
new_items = [true_or_false(item) for item in t.items]
|
|
874
|
+
return make_simplified_union(new_items, line=t.line, column=t.column)
|
|
875
|
+
|
|
876
|
+
new_t = copy_type(t)
|
|
877
|
+
new_t.can_be_true = new_t.can_be_true_default()
|
|
878
|
+
new_t.can_be_false = new_t.can_be_false_default()
|
|
879
|
+
return new_t
|
|
880
|
+
|
|
881
|
+
|
|
882
|
+
def erase_def_to_union_or_bound(tdef: TypeVarLikeType) -> Type:
|
|
883
|
+
# TODO(PEP612): fix for ParamSpecType
|
|
884
|
+
if isinstance(tdef, ParamSpecType):
|
|
885
|
+
return AnyType(TypeOfAny.from_error)
|
|
886
|
+
if isinstance(tdef, TypeVarType) and tdef.values:
|
|
887
|
+
return make_simplified_union(tdef.values)
|
|
888
|
+
else:
|
|
889
|
+
return tdef.upper_bound
|
|
890
|
+
|
|
891
|
+
|
|
892
|
+
def erase_to_union_or_bound(typ: TypeVarType) -> ProperType:
|
|
893
|
+
if typ.values:
|
|
894
|
+
return make_simplified_union(typ.values)
|
|
895
|
+
else:
|
|
896
|
+
return get_proper_type(typ.upper_bound)
|
|
897
|
+
|
|
898
|
+
|
|
899
|
+
def function_type(func: FuncBase, fallback: Instance) -> FunctionLike:
|
|
900
|
+
if func.type:
|
|
901
|
+
assert isinstance(func.type, FunctionLike)
|
|
902
|
+
return func.type
|
|
903
|
+
else:
|
|
904
|
+
# Implicit type signature with dynamic types.
|
|
905
|
+
if isinstance(func, FuncItem):
|
|
906
|
+
return callable_type(func, fallback)
|
|
907
|
+
else:
|
|
908
|
+
# Either a broken overload, or decorated overload type is not ready.
|
|
909
|
+
# TODO: make sure the caller defers if possible.
|
|
910
|
+
assert isinstance(func, OverloadedFuncDef)
|
|
911
|
+
any_type = AnyType(TypeOfAny.from_error)
|
|
912
|
+
dummy = CallableType(
|
|
913
|
+
[any_type, any_type],
|
|
914
|
+
[ARG_STAR, ARG_STAR2],
|
|
915
|
+
[None, None],
|
|
916
|
+
any_type,
|
|
917
|
+
fallback,
|
|
918
|
+
line=func.line,
|
|
919
|
+
is_ellipsis_args=True,
|
|
920
|
+
)
|
|
921
|
+
# Return an Overloaded, because some callers may expect that
|
|
922
|
+
# an OverloadedFuncDef has an Overloaded type.
|
|
923
|
+
return Overloaded([dummy])
|
|
924
|
+
|
|
925
|
+
|
|
926
|
+
def callable_type(
|
|
927
|
+
fdef: FuncItem, fallback: Instance, ret_type: Type | None = None
|
|
928
|
+
) -> CallableType:
|
|
929
|
+
# TODO: somewhat unfortunate duplication with prepare_method_signature in semanal
|
|
930
|
+
if fdef.info and fdef.has_self_or_cls_argument and fdef.arg_names:
|
|
931
|
+
self_type: Type = fill_typevars(fdef.info)
|
|
932
|
+
if fdef.is_class or fdef.name == "__new__":
|
|
933
|
+
self_type = TypeType.make_normalized(self_type)
|
|
934
|
+
args = [self_type] + [AnyType(TypeOfAny.unannotated)] * (len(fdef.arg_names) - 1)
|
|
935
|
+
else:
|
|
936
|
+
args = [AnyType(TypeOfAny.unannotated)] * len(fdef.arg_names)
|
|
937
|
+
|
|
938
|
+
return CallableType(
|
|
939
|
+
args,
|
|
940
|
+
fdef.arg_kinds,
|
|
941
|
+
fdef.arg_names,
|
|
942
|
+
ret_type or AnyType(TypeOfAny.unannotated),
|
|
943
|
+
fallback,
|
|
944
|
+
name=fdef.name,
|
|
945
|
+
line=fdef.line,
|
|
946
|
+
column=fdef.column,
|
|
947
|
+
implicit=True,
|
|
948
|
+
# We need this for better error messages, like missing `self` note:
|
|
949
|
+
definition=fdef if isinstance(fdef, FuncDef) else None,
|
|
950
|
+
)
|
|
951
|
+
|
|
952
|
+
|
|
953
|
+
def try_getting_str_literals(expr: Expression, typ: Type) -> list[str] | None:
|
|
954
|
+
"""If the given expression or type corresponds to a string literal
|
|
955
|
+
or a union of string literals, returns a list of the underlying strings.
|
|
956
|
+
Otherwise, returns None.
|
|
957
|
+
|
|
958
|
+
Specifically, this function is guaranteed to return a list with
|
|
959
|
+
one or more strings if one of the following is true:
|
|
960
|
+
|
|
961
|
+
1. 'expr' is a StrExpr
|
|
962
|
+
2. 'typ' is a LiteralType containing a string
|
|
963
|
+
3. 'typ' is a UnionType containing only LiteralType of strings
|
|
964
|
+
"""
|
|
965
|
+
if isinstance(expr, StrExpr):
|
|
966
|
+
return [expr.value]
|
|
967
|
+
|
|
968
|
+
# TODO: See if we can eliminate this function and call the below one directly
|
|
969
|
+
return try_getting_str_literals_from_type(typ)
|
|
970
|
+
|
|
971
|
+
|
|
972
|
+
def try_getting_str_literals_from_type(typ: Type) -> list[str] | None:
|
|
973
|
+
"""If the given expression or type corresponds to a string Literal
|
|
974
|
+
or a union of string Literals, returns a list of the underlying strings.
|
|
975
|
+
Otherwise, returns None.
|
|
976
|
+
|
|
977
|
+
For example, if we had the type 'Literal["foo", "bar"]' as input, this function
|
|
978
|
+
would return a list of strings ["foo", "bar"].
|
|
979
|
+
"""
|
|
980
|
+
return try_getting_literals_from_type(typ, str, "builtins.str")
|
|
981
|
+
|
|
982
|
+
|
|
983
|
+
def try_getting_int_literals_from_type(typ: Type) -> list[int] | None:
|
|
984
|
+
"""If the given expression or type corresponds to an int Literal
|
|
985
|
+
or a union of int Literals, returns a list of the underlying ints.
|
|
986
|
+
Otherwise, returns None.
|
|
987
|
+
|
|
988
|
+
For example, if we had the type 'Literal[1, 2, 3]' as input, this function
|
|
989
|
+
would return a list of ints [1, 2, 3].
|
|
990
|
+
"""
|
|
991
|
+
return try_getting_literals_from_type(typ, int, "builtins.int")
|
|
992
|
+
|
|
993
|
+
|
|
994
|
+
T = TypeVar("T")
|
|
995
|
+
|
|
996
|
+
|
|
997
|
+
def try_getting_literals_from_type(
|
|
998
|
+
typ: Type, target_literal_type: type[T], target_fullname: str
|
|
999
|
+
) -> list[T] | None:
|
|
1000
|
+
"""If the given expression or type corresponds to a Literal or
|
|
1001
|
+
union of Literals where the underlying values correspond to the given
|
|
1002
|
+
target type, returns a list of those underlying values. Otherwise,
|
|
1003
|
+
returns None.
|
|
1004
|
+
"""
|
|
1005
|
+
typ = get_proper_type(typ)
|
|
1006
|
+
|
|
1007
|
+
if isinstance(typ, Instance) and typ.last_known_value is not None:
|
|
1008
|
+
possible_literals: list[Type] = [typ.last_known_value]
|
|
1009
|
+
elif isinstance(typ, UnionType):
|
|
1010
|
+
possible_literals = list(typ.items)
|
|
1011
|
+
else:
|
|
1012
|
+
possible_literals = [typ]
|
|
1013
|
+
|
|
1014
|
+
literals: list[T] = []
|
|
1015
|
+
for lit in get_proper_types(possible_literals):
|
|
1016
|
+
if isinstance(lit, LiteralType) and lit.fallback.type.fullname == target_fullname:
|
|
1017
|
+
val = lit.value
|
|
1018
|
+
if isinstance(val, target_literal_type):
|
|
1019
|
+
literals.append(val)
|
|
1020
|
+
else:
|
|
1021
|
+
return None
|
|
1022
|
+
else:
|
|
1023
|
+
return None
|
|
1024
|
+
return literals
|
|
1025
|
+
|
|
1026
|
+
|
|
1027
|
+
def is_literal_type_like(t: Type | None) -> bool:
|
|
1028
|
+
"""Returns 'true' if the given type context is potentially either a LiteralType,
|
|
1029
|
+
a Union of LiteralType, or something similar.
|
|
1030
|
+
"""
|
|
1031
|
+
t = get_proper_type(t)
|
|
1032
|
+
if t is None:
|
|
1033
|
+
return False
|
|
1034
|
+
elif isinstance(t, LiteralType):
|
|
1035
|
+
return True
|
|
1036
|
+
elif isinstance(t, UnionType):
|
|
1037
|
+
return any(is_literal_type_like(item) for item in t.items)
|
|
1038
|
+
elif isinstance(t, TypeVarType):
|
|
1039
|
+
return is_literal_type_like(t.upper_bound) or any(
|
|
1040
|
+
is_literal_type_like(item) for item in t.values
|
|
1041
|
+
)
|
|
1042
|
+
else:
|
|
1043
|
+
return False
|
|
1044
|
+
|
|
1045
|
+
|
|
1046
|
+
def is_singleton_identity_type(typ: ProperType) -> bool:
|
|
1047
|
+
"""
|
|
1048
|
+
Returns True if every value of this type is identical to every other value of this type,
|
|
1049
|
+
as judged by the `is` operator.
|
|
1050
|
+
|
|
1051
|
+
Note that this is not true of certain LiteralType, such as Literal[100001] or Literal["string"]
|
|
1052
|
+
"""
|
|
1053
|
+
if isinstance(typ, NoneType):
|
|
1054
|
+
return True
|
|
1055
|
+
if isinstance(typ, Instance):
|
|
1056
|
+
return (
|
|
1057
|
+
(typ.type.is_enum and len(typ.type.enum_members) == 1)
|
|
1058
|
+
or (typ.type.fullname in ELLIPSIS_TYPE_NAMES)
|
|
1059
|
+
or (typ.type.fullname in NOT_IMPLEMENTED_TYPE_NAMES)
|
|
1060
|
+
or (typ.type.fullname in SENTINEL_TYPE_NAMES)
|
|
1061
|
+
)
|
|
1062
|
+
if isinstance(typ, LiteralType):
|
|
1063
|
+
return typ.is_enum_literal() or typ.is_sentinel_literal() or isinstance(typ.value, bool)
|
|
1064
|
+
if isinstance(typ, TypeType) and isinstance(typ.item, Instance) and typ.item.type.is_final:
|
|
1065
|
+
return True
|
|
1066
|
+
if isinstance(typ, FunctionLike) and typ.is_type_obj() and typ.type_object().is_final:
|
|
1067
|
+
return True
|
|
1068
|
+
return False
|
|
1069
|
+
|
|
1070
|
+
|
|
1071
|
+
def is_singleton_equality_type(typ: ProperType) -> bool:
|
|
1072
|
+
"""
|
|
1073
|
+
Returns True if every value of this type compares equal to every other value of this type,
|
|
1074
|
+
as judged by the `==` operator.
|
|
1075
|
+
"""
|
|
1076
|
+
return isinstance(typ, LiteralType) or is_singleton_identity_type(typ)
|
|
1077
|
+
|
|
1078
|
+
|
|
1079
|
+
def try_expanding_sum_type_to_union(typ: Type, target_fullname: str | None) -> Type:
|
|
1080
|
+
"""Attempts to recursively expand any enum Instances with the given target_fullname
|
|
1081
|
+
into a Union of all of its component LiteralTypes.
|
|
1082
|
+
|
|
1083
|
+
For example, if we have:
|
|
1084
|
+
|
|
1085
|
+
class Color(Enum):
|
|
1086
|
+
RED = 1
|
|
1087
|
+
BLUE = 2
|
|
1088
|
+
YELLOW = 3
|
|
1089
|
+
|
|
1090
|
+
class Status(Enum):
|
|
1091
|
+
SUCCESS = 1
|
|
1092
|
+
FAILURE = 2
|
|
1093
|
+
UNKNOWN = 3
|
|
1094
|
+
|
|
1095
|
+
...and if we call `try_expanding_sum_type_to_union(Union[Color, Status], 'module.Color')`,
|
|
1096
|
+
this function will return Literal[Color.RED, Color.BLUE, Color.YELLOW, Status].
|
|
1097
|
+
"""
|
|
1098
|
+
typ = get_proper_type(typ)
|
|
1099
|
+
|
|
1100
|
+
if isinstance(typ, UnionType):
|
|
1101
|
+
# Non-empty enums cannot subclass each other so simply removing duplicates is enough.
|
|
1102
|
+
items = [
|
|
1103
|
+
try_expanding_sum_type_to_union(item, target_fullname)
|
|
1104
|
+
for item in remove_dups(flatten_nested_unions(typ.relevant_items()))
|
|
1105
|
+
]
|
|
1106
|
+
return UnionType.make_union(items)
|
|
1107
|
+
|
|
1108
|
+
if isinstance(typ, Instance) and (
|
|
1109
|
+
target_fullname is None or typ.type.fullname == target_fullname
|
|
1110
|
+
):
|
|
1111
|
+
if typ.type.fullname == "builtins.bool":
|
|
1112
|
+
return UnionType([LiteralType(True, typ), LiteralType(False, typ)])
|
|
1113
|
+
|
|
1114
|
+
if typ.type.is_enum:
|
|
1115
|
+
items = [LiteralType(name, typ) for name in typ.type.enum_members]
|
|
1116
|
+
if not items:
|
|
1117
|
+
return typ
|
|
1118
|
+
return UnionType.make_union(items)
|
|
1119
|
+
|
|
1120
|
+
return typ
|
|
1121
|
+
|
|
1122
|
+
|
|
1123
|
+
def try_contracting_literals_in_union(types: Sequence[Type]) -> list[ProperType]:
|
|
1124
|
+
"""Contracts any literal types back into a sum type if possible.
|
|
1125
|
+
|
|
1126
|
+
Requires a flattened union and does not descend into children.
|
|
1127
|
+
|
|
1128
|
+
Will replace the first instance of the literal with the sum type and
|
|
1129
|
+
remove all others.
|
|
1130
|
+
|
|
1131
|
+
If we call `try_contracting_union(Literal[Color.RED, Color.BLUE, Color.YELLOW])`,
|
|
1132
|
+
this function will return Color.
|
|
1133
|
+
|
|
1134
|
+
We also treat `Literal[True, False]` as `bool`.
|
|
1135
|
+
"""
|
|
1136
|
+
proper_types = [get_proper_type(typ) for typ in types]
|
|
1137
|
+
sum_types: dict[str, tuple[set[Any], list[int]]] = {}
|
|
1138
|
+
marked_for_deletion = set()
|
|
1139
|
+
for idx, typ in enumerate(proper_types):
|
|
1140
|
+
if isinstance(typ, LiteralType):
|
|
1141
|
+
fullname = typ.fallback.type.fullname
|
|
1142
|
+
if typ.fallback.type.is_enum or isinstance(typ.value, bool):
|
|
1143
|
+
if fullname not in sum_types:
|
|
1144
|
+
sum_types[fullname] = (
|
|
1145
|
+
(
|
|
1146
|
+
set(typ.fallback.type.enum_members)
|
|
1147
|
+
if typ.fallback.type.is_enum
|
|
1148
|
+
else {True, False}
|
|
1149
|
+
),
|
|
1150
|
+
[],
|
|
1151
|
+
)
|
|
1152
|
+
literals, indexes = sum_types[fullname]
|
|
1153
|
+
literals.discard(typ.value)
|
|
1154
|
+
indexes.append(idx)
|
|
1155
|
+
if not literals:
|
|
1156
|
+
first, *rest = indexes
|
|
1157
|
+
proper_types[first] = typ.fallback
|
|
1158
|
+
marked_for_deletion |= set(rest)
|
|
1159
|
+
return list(
|
|
1160
|
+
itertools.compress(
|
|
1161
|
+
proper_types, [(i not in marked_for_deletion) for i in range(len(proper_types))]
|
|
1162
|
+
)
|
|
1163
|
+
)
|
|
1164
|
+
|
|
1165
|
+
|
|
1166
|
+
def coerce_to_literal(typ: Type) -> Type:
|
|
1167
|
+
"""Recursively converts any Instances that have a last_known_value or are
|
|
1168
|
+
instances of enum types with a single value into the corresponding LiteralType.
|
|
1169
|
+
"""
|
|
1170
|
+
original_type = typ
|
|
1171
|
+
typ = get_proper_type(typ)
|
|
1172
|
+
if isinstance(typ, UnionType):
|
|
1173
|
+
new_items = [coerce_to_literal(item) for item in typ.items]
|
|
1174
|
+
return UnionType.make_union(new_items)
|
|
1175
|
+
elif isinstance(typ, Instance):
|
|
1176
|
+
if typ.last_known_value:
|
|
1177
|
+
return typ.last_known_value
|
|
1178
|
+
elif typ.type.is_enum:
|
|
1179
|
+
enum_values = typ.type.enum_members
|
|
1180
|
+
if len(enum_values) == 1:
|
|
1181
|
+
return LiteralType(value=enum_values[0], fallback=typ)
|
|
1182
|
+
return original_type
|
|
1183
|
+
|
|
1184
|
+
|
|
1185
|
+
def get_type_vars(tp: Type) -> list[TypeVarType]:
|
|
1186
|
+
return cast("list[TypeVarType]", tp.accept(TypeVarExtractor()))
|
|
1187
|
+
|
|
1188
|
+
|
|
1189
|
+
def get_all_type_vars(tp: Type) -> list[TypeVarLikeType]:
|
|
1190
|
+
# TODO: should we always use this function instead of get_type_vars() above?
|
|
1191
|
+
return tp.accept(TypeVarExtractor(include_all=True))
|
|
1192
|
+
|
|
1193
|
+
|
|
1194
|
+
class TypeVarExtractor(TypeQuery[list[TypeVarLikeType]]):
|
|
1195
|
+
def __init__(self, include_all: bool = False) -> None:
|
|
1196
|
+
super().__init__()
|
|
1197
|
+
self.include_all = include_all
|
|
1198
|
+
|
|
1199
|
+
def strategy(self, items: Iterable[list[TypeVarLikeType]]) -> list[TypeVarLikeType]:
|
|
1200
|
+
out = []
|
|
1201
|
+
for item in items:
|
|
1202
|
+
out.extend(item)
|
|
1203
|
+
return out
|
|
1204
|
+
|
|
1205
|
+
def visit_type_var(self, t: TypeVarType) -> list[TypeVarLikeType]:
|
|
1206
|
+
return [t]
|
|
1207
|
+
|
|
1208
|
+
def visit_param_spec(self, t: ParamSpecType) -> list[TypeVarLikeType]:
|
|
1209
|
+
return [t] if self.include_all else []
|
|
1210
|
+
|
|
1211
|
+
def visit_type_var_tuple(self, t: TypeVarTupleType) -> list[TypeVarLikeType]:
|
|
1212
|
+
return [t] if self.include_all else []
|
|
1213
|
+
|
|
1214
|
+
|
|
1215
|
+
def freeze_all_type_vars(member_type: Type) -> None:
|
|
1216
|
+
member_type.accept(FreezeTypeVarsVisitor())
|
|
1217
|
+
|
|
1218
|
+
|
|
1219
|
+
class FreezeTypeVarsVisitor(TypeTraverserVisitor):
|
|
1220
|
+
def visit_callable_type(self, t: CallableType) -> None:
|
|
1221
|
+
for v in t.variables:
|
|
1222
|
+
v.id.meta_level = 0
|
|
1223
|
+
super().visit_callable_type(t)
|
|
1224
|
+
|
|
1225
|
+
|
|
1226
|
+
def custom_special_method(typ: Type, name: str, check_all: bool = False) -> bool:
|
|
1227
|
+
"""Does this type have a custom special method such as __format__() or __eq__()?
|
|
1228
|
+
|
|
1229
|
+
If check_all is True ensure all items of a union have a custom method, not just some.
|
|
1230
|
+
"""
|
|
1231
|
+
typ = get_proper_type(typ)
|
|
1232
|
+
if isinstance(typ, Instance):
|
|
1233
|
+
method = typ.type.get(name)
|
|
1234
|
+
if method and isinstance(method.node, (SYMBOL_FUNCBASE_TYPES, Decorator, Var)):
|
|
1235
|
+
if method.node.info:
|
|
1236
|
+
return not method.node.info.fullname.startswith(("builtins.", "typing."))
|
|
1237
|
+
return False
|
|
1238
|
+
if isinstance(typ, UnionType):
|
|
1239
|
+
if check_all:
|
|
1240
|
+
return all(custom_special_method(t, name, check_all) for t in typ.items)
|
|
1241
|
+
return any(custom_special_method(t, name) for t in typ.items)
|
|
1242
|
+
if isinstance(typ, TupleType):
|
|
1243
|
+
return custom_special_method(tuple_fallback(typ), name, check_all)
|
|
1244
|
+
if isinstance(typ, FunctionLike) and typ.is_type_obj():
|
|
1245
|
+
# Look up __method__ on the metaclass for class objects.
|
|
1246
|
+
return custom_special_method(typ.fallback, name, check_all)
|
|
1247
|
+
if isinstance(typ, TypeType) and isinstance(typ.item, Instance):
|
|
1248
|
+
if typ.item.type.metaclass_type:
|
|
1249
|
+
# Look up __method__ on the metaclass for class objects.
|
|
1250
|
+
return custom_special_method(typ.item.type.metaclass_type, name, check_all)
|
|
1251
|
+
if isinstance(typ, AnyType):
|
|
1252
|
+
# Avoid false positives in uncertain cases.
|
|
1253
|
+
return True
|
|
1254
|
+
# TODO: support other types (see ExpressionChecker.has_member())?
|
|
1255
|
+
return False
|
|
1256
|
+
|
|
1257
|
+
|
|
1258
|
+
def separate_union_literals(t: UnionType) -> tuple[Sequence[LiteralType], Sequence[Type]]:
|
|
1259
|
+
"""Separate literals from other members in a union type."""
|
|
1260
|
+
literal_items = []
|
|
1261
|
+
union_items = []
|
|
1262
|
+
|
|
1263
|
+
for item in t.items:
|
|
1264
|
+
proper = get_proper_type(item)
|
|
1265
|
+
if isinstance(proper, LiteralType):
|
|
1266
|
+
literal_items.append(proper)
|
|
1267
|
+
else:
|
|
1268
|
+
union_items.append(item)
|
|
1269
|
+
|
|
1270
|
+
return literal_items, union_items
|
|
1271
|
+
|
|
1272
|
+
|
|
1273
|
+
def try_getting_instance_fallback(typ: Type) -> Instance | None:
|
|
1274
|
+
"""Returns the Instance fallback for this type if one exists or None."""
|
|
1275
|
+
typ = get_proper_type(typ)
|
|
1276
|
+
if isinstance(typ, Instance):
|
|
1277
|
+
return typ
|
|
1278
|
+
elif isinstance(typ, LiteralType):
|
|
1279
|
+
return typ.fallback
|
|
1280
|
+
elif isinstance(typ, (NoneType, AnyType)):
|
|
1281
|
+
return None # Fast path for None, which is common
|
|
1282
|
+
elif isinstance(typ, FunctionLike):
|
|
1283
|
+
return typ.fallback
|
|
1284
|
+
elif isinstance(typ, TypeVarType):
|
|
1285
|
+
return try_getting_instance_fallback(typ.upper_bound)
|
|
1286
|
+
elif isinstance(typ, TupleType):
|
|
1287
|
+
return typ.partial_fallback
|
|
1288
|
+
elif isinstance(typ, TypedDictType):
|
|
1289
|
+
return typ.fallback
|
|
1290
|
+
return None
|
|
1291
|
+
|
|
1292
|
+
|
|
1293
|
+
def fixup_partial_type(typ: Type) -> Type:
|
|
1294
|
+
"""Convert a partial type that we couldn't resolve into something concrete.
|
|
1295
|
+
|
|
1296
|
+
This means, for None we make it Optional[Any], and for anything else we
|
|
1297
|
+
fill in all of the type arguments with Any.
|
|
1298
|
+
"""
|
|
1299
|
+
if not isinstance(typ, PartialType):
|
|
1300
|
+
return typ
|
|
1301
|
+
if typ.type is None:
|
|
1302
|
+
return UnionType.make_union([AnyType(TypeOfAny.unannotated), NoneType()])
|
|
1303
|
+
else:
|
|
1304
|
+
return Instance(typ.type, [AnyType(TypeOfAny.unannotated)] * len(typ.type.type_vars))
|
|
1305
|
+
|
|
1306
|
+
|
|
1307
|
+
def _is_disjoint_base(info: TypeInfo) -> bool:
|
|
1308
|
+
# It either has the @disjoint_base decorator or defines nonempty __slots__.
|
|
1309
|
+
if info.is_disjoint_base:
|
|
1310
|
+
return True
|
|
1311
|
+
if not info.slots:
|
|
1312
|
+
return False
|
|
1313
|
+
own_slots = {
|
|
1314
|
+
slot
|
|
1315
|
+
for slot in info.slots
|
|
1316
|
+
if not any(
|
|
1317
|
+
base_info.type.slots is not None and slot in base_info.type.slots
|
|
1318
|
+
for base_info in info.bases
|
|
1319
|
+
)
|
|
1320
|
+
}
|
|
1321
|
+
return bool(own_slots)
|
|
1322
|
+
|
|
1323
|
+
|
|
1324
|
+
def _get_disjoint_base_of(instance: Instance) -> TypeInfo | None:
|
|
1325
|
+
"""Returns the disjoint base of the given instance, if it exists."""
|
|
1326
|
+
if _is_disjoint_base(instance.type):
|
|
1327
|
+
return instance.type
|
|
1328
|
+
for base in instance.type.mro:
|
|
1329
|
+
if _is_disjoint_base(base):
|
|
1330
|
+
return base
|
|
1331
|
+
return None
|
|
1332
|
+
|
|
1333
|
+
|
|
1334
|
+
def can_have_shared_disjoint_base(instances: list[Instance]) -> bool:
|
|
1335
|
+
"""Returns whether the given instances can share a disjoint base.
|
|
1336
|
+
|
|
1337
|
+
This means that a child class of these classes can exist at runtime.
|
|
1338
|
+
"""
|
|
1339
|
+
# Ignore None disjoint bases (which are `object`).
|
|
1340
|
+
disjoint_bases = [
|
|
1341
|
+
base for instance in instances if (base := _get_disjoint_base_of(instance)) is not None
|
|
1342
|
+
]
|
|
1343
|
+
if not disjoint_bases:
|
|
1344
|
+
# All are `object`.
|
|
1345
|
+
return True
|
|
1346
|
+
|
|
1347
|
+
candidate = disjoint_bases[0]
|
|
1348
|
+
for base in disjoint_bases[1:]:
|
|
1349
|
+
if candidate.has_base(base.fullname):
|
|
1350
|
+
continue
|
|
1351
|
+
elif base.has_base(candidate.fullname):
|
|
1352
|
+
candidate = base
|
|
1353
|
+
else:
|
|
1354
|
+
return False
|
|
1355
|
+
return True
|