@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,1666 @@
|
|
|
1
|
+
"""Test cases for mypy types and type operations."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import re
|
|
6
|
+
from unittest import TestCase, skipUnless
|
|
7
|
+
|
|
8
|
+
from librt.internal import ReadBuffer, WriteBuffer
|
|
9
|
+
|
|
10
|
+
from mypy.cache import read_tag
|
|
11
|
+
from mypy.erasetype import erase_type, remove_instance_last_known_values
|
|
12
|
+
from mypy.indirection import TypeIndirectionVisitor
|
|
13
|
+
from mypy.join import join_types
|
|
14
|
+
from mypy.meet import is_overlapping_types, meet_types, narrow_declared_type
|
|
15
|
+
from mypy.nodes import (
|
|
16
|
+
ARG_NAMED,
|
|
17
|
+
ARG_OPT,
|
|
18
|
+
ARG_POS,
|
|
19
|
+
ARG_STAR,
|
|
20
|
+
ARG_STAR2,
|
|
21
|
+
CONTRAVARIANT,
|
|
22
|
+
COVARIANT,
|
|
23
|
+
INVARIANT,
|
|
24
|
+
ArgKind,
|
|
25
|
+
CallExpr,
|
|
26
|
+
Expression,
|
|
27
|
+
NameExpr,
|
|
28
|
+
)
|
|
29
|
+
from mypy.plugins.common import find_shallow_matching_overload_item
|
|
30
|
+
from mypy.state import state
|
|
31
|
+
from mypy.subtypes import is_more_precise, is_proper_subtype, is_same_type, is_subtype
|
|
32
|
+
from mypy.test.helpers import Suite, assert_equal, assert_type, skip
|
|
33
|
+
from mypy.test.typefixture import InterfaceTypeFixture, TypeFixture
|
|
34
|
+
from mypy.typeops import false_only, make_simplified_union, true_only
|
|
35
|
+
from mypy.types import (
|
|
36
|
+
LITERAL_TYPE,
|
|
37
|
+
AnyType,
|
|
38
|
+
CallableType,
|
|
39
|
+
Instance,
|
|
40
|
+
LiteralType,
|
|
41
|
+
NoneType,
|
|
42
|
+
Overloaded,
|
|
43
|
+
ProperType,
|
|
44
|
+
SentinelValue,
|
|
45
|
+
TupleType,
|
|
46
|
+
Type,
|
|
47
|
+
TypedDictType,
|
|
48
|
+
TypeOfAny,
|
|
49
|
+
TypeType,
|
|
50
|
+
TypeVarId,
|
|
51
|
+
TypeVarType,
|
|
52
|
+
UnboundType,
|
|
53
|
+
UninhabitedType,
|
|
54
|
+
UnionType,
|
|
55
|
+
UnpackType,
|
|
56
|
+
get_proper_type,
|
|
57
|
+
has_recursive_types,
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
# Solving the import cycle:
|
|
61
|
+
import mypy.expandtype # ruff: isort: skip
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
class TypesSuite(Suite):
|
|
65
|
+
def setUp(self) -> None:
|
|
66
|
+
self.x = UnboundType("X") # Helpers
|
|
67
|
+
self.y = UnboundType("Y")
|
|
68
|
+
self.fx = TypeFixture()
|
|
69
|
+
self.function = self.fx.function
|
|
70
|
+
|
|
71
|
+
def test_any(self) -> None:
|
|
72
|
+
assert_equal(str(AnyType(TypeOfAny.special_form)), "Any")
|
|
73
|
+
|
|
74
|
+
def test_sentinel_literal_json_roundtrip(self) -> None:
|
|
75
|
+
literal = LiteralType(SentinelValue("__main__.MISSING", "MISSING"), self.fx.a)
|
|
76
|
+
assert_equal(str(literal), "MISSING")
|
|
77
|
+
data = literal.serialize()
|
|
78
|
+
assert isinstance(data, dict)
|
|
79
|
+
roundtrip = LiteralType.deserialize(data)
|
|
80
|
+
self.assertEqual(roundtrip.value, literal.value)
|
|
81
|
+
self.assertEqual(roundtrip.fallback.type_ref, self.fx.a.type.fullname)
|
|
82
|
+
|
|
83
|
+
def test_sentinel_literal_ff_roundtrip(self) -> None:
|
|
84
|
+
literal = LiteralType(SentinelValue("__main__.MISSING", "MISSING"), self.fx.a)
|
|
85
|
+
data = WriteBuffer()
|
|
86
|
+
literal.write(data)
|
|
87
|
+
buffer = ReadBuffer(data.getvalue())
|
|
88
|
+
assert read_tag(buffer) == LITERAL_TYPE
|
|
89
|
+
roundtrip = LiteralType.read(buffer)
|
|
90
|
+
self.assertEqual(roundtrip.value, literal.value)
|
|
91
|
+
self.assertEqual(roundtrip.fallback.type_ref, self.fx.a.type.fullname)
|
|
92
|
+
|
|
93
|
+
def test_simple_unbound_type(self) -> None:
|
|
94
|
+
u = UnboundType("Foo")
|
|
95
|
+
assert_equal(str(u), "Foo?")
|
|
96
|
+
|
|
97
|
+
def test_generic_unbound_type(self) -> None:
|
|
98
|
+
u = UnboundType("Foo", [UnboundType("T"), AnyType(TypeOfAny.special_form)])
|
|
99
|
+
assert_equal(str(u), "Foo?[T?, Any]")
|
|
100
|
+
|
|
101
|
+
def test_callable_type(self) -> None:
|
|
102
|
+
c = CallableType(
|
|
103
|
+
[self.x, self.y],
|
|
104
|
+
[ARG_POS, ARG_POS],
|
|
105
|
+
[None, None],
|
|
106
|
+
AnyType(TypeOfAny.special_form),
|
|
107
|
+
self.function,
|
|
108
|
+
)
|
|
109
|
+
assert_equal(str(c), "def (X?, Y?) -> Any")
|
|
110
|
+
|
|
111
|
+
c2 = CallableType([], [], [], NoneType(), self.fx.function)
|
|
112
|
+
assert_equal(str(c2), "def ()")
|
|
113
|
+
|
|
114
|
+
def test_callable_type_with_default_args(self) -> None:
|
|
115
|
+
c = CallableType(
|
|
116
|
+
[self.x, self.y],
|
|
117
|
+
[ARG_POS, ARG_OPT],
|
|
118
|
+
[None, None],
|
|
119
|
+
AnyType(TypeOfAny.special_form),
|
|
120
|
+
self.function,
|
|
121
|
+
)
|
|
122
|
+
assert_equal(str(c), "def (X?, Y? =) -> Any")
|
|
123
|
+
|
|
124
|
+
c2 = CallableType(
|
|
125
|
+
[self.x, self.y],
|
|
126
|
+
[ARG_OPT, ARG_OPT],
|
|
127
|
+
[None, None],
|
|
128
|
+
AnyType(TypeOfAny.special_form),
|
|
129
|
+
self.function,
|
|
130
|
+
)
|
|
131
|
+
assert_equal(str(c2), "def (X? =, Y? =) -> Any")
|
|
132
|
+
|
|
133
|
+
def test_callable_type_with_var_args(self) -> None:
|
|
134
|
+
c = CallableType(
|
|
135
|
+
[self.x], [ARG_STAR], [None], AnyType(TypeOfAny.special_form), self.function
|
|
136
|
+
)
|
|
137
|
+
assert_equal(str(c), "def (*X?) -> Any")
|
|
138
|
+
|
|
139
|
+
c2 = CallableType(
|
|
140
|
+
[self.x, self.y],
|
|
141
|
+
[ARG_POS, ARG_STAR],
|
|
142
|
+
[None, None],
|
|
143
|
+
AnyType(TypeOfAny.special_form),
|
|
144
|
+
self.function,
|
|
145
|
+
)
|
|
146
|
+
assert_equal(str(c2), "def (X?, *Y?) -> Any")
|
|
147
|
+
|
|
148
|
+
c3 = CallableType(
|
|
149
|
+
[self.x, self.y],
|
|
150
|
+
[ARG_OPT, ARG_STAR],
|
|
151
|
+
[None, None],
|
|
152
|
+
AnyType(TypeOfAny.special_form),
|
|
153
|
+
self.function,
|
|
154
|
+
)
|
|
155
|
+
assert_equal(str(c3), "def (X? =, *Y?) -> Any")
|
|
156
|
+
|
|
157
|
+
def test_tuple_type_str(self) -> None:
|
|
158
|
+
t1 = TupleType([], self.fx.std_tuple)
|
|
159
|
+
assert_equal(str(t1), "tuple[()]")
|
|
160
|
+
t2 = TupleType([self.x], self.fx.std_tuple)
|
|
161
|
+
assert_equal(str(t2), "tuple[X?]")
|
|
162
|
+
t3 = TupleType([self.x, AnyType(TypeOfAny.special_form)], self.fx.std_tuple)
|
|
163
|
+
assert_equal(str(t3), "tuple[X?, Any]")
|
|
164
|
+
|
|
165
|
+
def test_type_variable_binding(self) -> None:
|
|
166
|
+
assert_equal(
|
|
167
|
+
str(
|
|
168
|
+
TypeVarType(
|
|
169
|
+
"X", "X", TypeVarId(1), [], self.fx.o, AnyType(TypeOfAny.from_omitted_generics)
|
|
170
|
+
)
|
|
171
|
+
),
|
|
172
|
+
"X",
|
|
173
|
+
)
|
|
174
|
+
assert_equal(
|
|
175
|
+
str(
|
|
176
|
+
TypeVarType(
|
|
177
|
+
"X",
|
|
178
|
+
"X",
|
|
179
|
+
TypeVarId(1),
|
|
180
|
+
[self.x, self.y],
|
|
181
|
+
self.fx.o,
|
|
182
|
+
AnyType(TypeOfAny.from_omitted_generics),
|
|
183
|
+
)
|
|
184
|
+
),
|
|
185
|
+
"X",
|
|
186
|
+
)
|
|
187
|
+
|
|
188
|
+
def test_generic_function_type(self) -> None:
|
|
189
|
+
c = CallableType(
|
|
190
|
+
[self.x, self.y],
|
|
191
|
+
[ARG_POS, ARG_POS],
|
|
192
|
+
[None, None],
|
|
193
|
+
self.y,
|
|
194
|
+
self.function,
|
|
195
|
+
name=None,
|
|
196
|
+
variables=[
|
|
197
|
+
TypeVarType(
|
|
198
|
+
"X",
|
|
199
|
+
"X",
|
|
200
|
+
TypeVarId(-1),
|
|
201
|
+
[],
|
|
202
|
+
self.fx.o,
|
|
203
|
+
AnyType(TypeOfAny.from_omitted_generics),
|
|
204
|
+
)
|
|
205
|
+
],
|
|
206
|
+
)
|
|
207
|
+
assert_equal(str(c), "def [X] (X?, Y?) -> Y?")
|
|
208
|
+
|
|
209
|
+
v = [
|
|
210
|
+
TypeVarType(
|
|
211
|
+
"Y", "Y", TypeVarId(-1), [], self.fx.o, AnyType(TypeOfAny.from_omitted_generics)
|
|
212
|
+
),
|
|
213
|
+
TypeVarType(
|
|
214
|
+
"X", "X", TypeVarId(-2), [], self.fx.o, AnyType(TypeOfAny.from_omitted_generics)
|
|
215
|
+
),
|
|
216
|
+
]
|
|
217
|
+
c2 = CallableType([], [], [], NoneType(), self.function, name=None, variables=v)
|
|
218
|
+
assert_equal(str(c2), "def [Y, X] ()")
|
|
219
|
+
|
|
220
|
+
def test_type_alias_expand_once(self) -> None:
|
|
221
|
+
A, target = self.fx.def_alias_1(self.fx.a)
|
|
222
|
+
assert get_proper_type(target) == target
|
|
223
|
+
assert get_proper_type(A) == target
|
|
224
|
+
|
|
225
|
+
A, target = self.fx.def_alias_2(self.fx.a)
|
|
226
|
+
assert get_proper_type(target) == target
|
|
227
|
+
assert get_proper_type(A) == target
|
|
228
|
+
|
|
229
|
+
def test_recursive_nested_in_non_recursive(self) -> None:
|
|
230
|
+
A, _ = self.fx.def_alias_1(self.fx.a)
|
|
231
|
+
T = TypeVarType(
|
|
232
|
+
"T", "T", TypeVarId(-1), [], self.fx.o, AnyType(TypeOfAny.from_omitted_generics)
|
|
233
|
+
)
|
|
234
|
+
NA = self.fx.non_rec_alias(Instance(self.fx.gi, [T]), [T], [A])
|
|
235
|
+
assert not NA.is_recursive
|
|
236
|
+
assert has_recursive_types(NA)
|
|
237
|
+
|
|
238
|
+
def test_indirection_no_infinite_recursion(self) -> None:
|
|
239
|
+
A, _ = self.fx.def_alias_1(self.fx.a)
|
|
240
|
+
visitor = TypeIndirectionVisitor()
|
|
241
|
+
A.accept(visitor)
|
|
242
|
+
modules = visitor.modules
|
|
243
|
+
assert modules == {"__main__", "builtins"}
|
|
244
|
+
|
|
245
|
+
A, _ = self.fx.def_alias_2(self.fx.a)
|
|
246
|
+
visitor = TypeIndirectionVisitor()
|
|
247
|
+
A.accept(visitor)
|
|
248
|
+
modules = visitor.modules
|
|
249
|
+
assert modules == {"__main__", "builtins"}
|
|
250
|
+
|
|
251
|
+
def test_typeddict_type_constructor_signature(self) -> None:
|
|
252
|
+
typ = TypedDictType({"x": self.fx.o}, {"x"}, set(), self.fx.a, 10, 20)
|
|
253
|
+
|
|
254
|
+
assert typ.fallback is self.fx.a
|
|
255
|
+
assert_equal(typ.line, 10)
|
|
256
|
+
assert_equal(typ.column, 20)
|
|
257
|
+
assert not typ.is_closed
|
|
258
|
+
|
|
259
|
+
closed = TypedDictType({"x": self.fx.o}, {"x"}, set(), self.fx.a, is_closed=True)
|
|
260
|
+
assert closed.is_closed
|
|
261
|
+
|
|
262
|
+
with self.assertRaises(TypeError):
|
|
263
|
+
TypedDictType( # type: ignore[call-arg]
|
|
264
|
+
{"x": self.fx.o}, {"x"}, set(), self.fx.a, 10, 20, True
|
|
265
|
+
)
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
class TypeOpsSuite(Suite):
|
|
269
|
+
def setUp(self) -> None:
|
|
270
|
+
self.fx = TypeFixture(INVARIANT)
|
|
271
|
+
self.fx_co = TypeFixture(COVARIANT)
|
|
272
|
+
self.fx_contra = TypeFixture(CONTRAVARIANT)
|
|
273
|
+
|
|
274
|
+
# expand_type
|
|
275
|
+
|
|
276
|
+
def test_trivial_expand(self) -> None:
|
|
277
|
+
for t in (
|
|
278
|
+
self.fx.a,
|
|
279
|
+
self.fx.o,
|
|
280
|
+
self.fx.t,
|
|
281
|
+
self.fx.nonet,
|
|
282
|
+
self.tuple(self.fx.a),
|
|
283
|
+
self.callable([], self.fx.a, self.fx.a),
|
|
284
|
+
self.fx.anyt,
|
|
285
|
+
):
|
|
286
|
+
self.assert_expand(t, [], t)
|
|
287
|
+
self.assert_expand(t, [], t)
|
|
288
|
+
self.assert_expand(t, [], t)
|
|
289
|
+
|
|
290
|
+
def test_trivial_expand_recursive(self) -> None:
|
|
291
|
+
A, _ = self.fx.def_alias_1(self.fx.a)
|
|
292
|
+
self.assert_expand(A, [], A)
|
|
293
|
+
A, _ = self.fx.def_alias_2(self.fx.a)
|
|
294
|
+
self.assert_expand(A, [], A)
|
|
295
|
+
|
|
296
|
+
def test_expand_naked_type_var(self) -> None:
|
|
297
|
+
self.assert_expand(self.fx.t, [(self.fx.t.id, self.fx.a)], self.fx.a)
|
|
298
|
+
self.assert_expand(self.fx.t, [(self.fx.s.id, self.fx.a)], self.fx.t)
|
|
299
|
+
|
|
300
|
+
def test_expand_basic_generic_types(self) -> None:
|
|
301
|
+
self.assert_expand(self.fx.gt, [(self.fx.t.id, self.fx.a)], self.fx.ga)
|
|
302
|
+
|
|
303
|
+
# IDEA: Add test cases for
|
|
304
|
+
# tuple types
|
|
305
|
+
# callable types
|
|
306
|
+
# multiple arguments
|
|
307
|
+
|
|
308
|
+
def assert_expand(
|
|
309
|
+
self, orig: Type, map_items: list[tuple[TypeVarId, Type]], result: Type
|
|
310
|
+
) -> None:
|
|
311
|
+
lower_bounds = {}
|
|
312
|
+
|
|
313
|
+
for id, t in map_items:
|
|
314
|
+
lower_bounds[id] = t
|
|
315
|
+
|
|
316
|
+
exp = mypy.expandtype.expand_type(orig, lower_bounds)
|
|
317
|
+
# Remove erased tags (asterisks).
|
|
318
|
+
assert_equal(str(exp).replace("*", ""), str(result))
|
|
319
|
+
|
|
320
|
+
# erase_type
|
|
321
|
+
|
|
322
|
+
def test_trivial_erase(self) -> None:
|
|
323
|
+
for t in (self.fx.a, self.fx.o, self.fx.nonet, self.fx.anyt):
|
|
324
|
+
self.assert_erase(t, t)
|
|
325
|
+
|
|
326
|
+
def test_erase_with_type_variable(self) -> None:
|
|
327
|
+
self.assert_erase(self.fx.t, self.fx.anyt)
|
|
328
|
+
|
|
329
|
+
def test_erase_with_generic_type(self) -> None:
|
|
330
|
+
self.assert_erase(self.fx.ga, self.fx.gdyn)
|
|
331
|
+
self.assert_erase(self.fx.hab, Instance(self.fx.hi, [self.fx.anyt, self.fx.anyt]))
|
|
332
|
+
|
|
333
|
+
def test_erase_with_generic_type_recursive(self) -> None:
|
|
334
|
+
tuple_any = Instance(self.fx.std_tuplei, [AnyType(TypeOfAny.explicit)])
|
|
335
|
+
A, _ = self.fx.def_alias_1(self.fx.a)
|
|
336
|
+
self.assert_erase(A, tuple_any)
|
|
337
|
+
A, _ = self.fx.def_alias_2(self.fx.a)
|
|
338
|
+
self.assert_erase(A, UnionType([self.fx.a, tuple_any]))
|
|
339
|
+
|
|
340
|
+
def test_erase_with_tuple_type(self) -> None:
|
|
341
|
+
self.assert_erase(self.tuple(self.fx.a), self.fx.std_tuple)
|
|
342
|
+
|
|
343
|
+
def test_erase_with_function_type(self) -> None:
|
|
344
|
+
self.assert_erase(
|
|
345
|
+
self.fx.callable(self.fx.a, self.fx.b),
|
|
346
|
+
CallableType(
|
|
347
|
+
arg_types=[self.fx.anyt, self.fx.anyt],
|
|
348
|
+
arg_kinds=[ARG_STAR, ARG_STAR2],
|
|
349
|
+
arg_names=[None, None],
|
|
350
|
+
ret_type=self.fx.anyt,
|
|
351
|
+
fallback=self.fx.function,
|
|
352
|
+
),
|
|
353
|
+
)
|
|
354
|
+
|
|
355
|
+
def test_erase_with_type_object(self) -> None:
|
|
356
|
+
self.assert_erase(
|
|
357
|
+
self.fx.callable_type(self.fx.a, self.fx.b),
|
|
358
|
+
CallableType(
|
|
359
|
+
arg_types=[self.fx.anyt, self.fx.anyt],
|
|
360
|
+
arg_kinds=[ARG_STAR, ARG_STAR2],
|
|
361
|
+
arg_names=[None, None],
|
|
362
|
+
ret_type=self.fx.anyt,
|
|
363
|
+
fallback=self.fx.type_type,
|
|
364
|
+
),
|
|
365
|
+
)
|
|
366
|
+
|
|
367
|
+
def test_erase_with_type_type(self) -> None:
|
|
368
|
+
self.assert_erase(self.fx.type_a, self.fx.type_a)
|
|
369
|
+
self.assert_erase(self.fx.type_t, self.fx.type_any)
|
|
370
|
+
|
|
371
|
+
def assert_erase(self, orig: Type, result: Type) -> None:
|
|
372
|
+
assert_equal(str(erase_type(orig)), str(result))
|
|
373
|
+
|
|
374
|
+
# is_more_precise
|
|
375
|
+
|
|
376
|
+
def test_is_more_precise(self) -> None:
|
|
377
|
+
fx = self.fx
|
|
378
|
+
assert is_more_precise(fx.b, fx.a)
|
|
379
|
+
assert is_more_precise(fx.b, fx.b)
|
|
380
|
+
assert is_more_precise(fx.b, fx.b)
|
|
381
|
+
assert is_more_precise(fx.b, fx.anyt)
|
|
382
|
+
assert is_more_precise(self.tuple(fx.b, fx.a), self.tuple(fx.b, fx.a))
|
|
383
|
+
assert is_more_precise(self.tuple(fx.b, fx.b), self.tuple(fx.b, fx.a))
|
|
384
|
+
|
|
385
|
+
assert not is_more_precise(fx.a, fx.b)
|
|
386
|
+
assert not is_more_precise(fx.anyt, fx.b)
|
|
387
|
+
|
|
388
|
+
# is_proper_subtype
|
|
389
|
+
|
|
390
|
+
def test_is_proper_subtype(self) -> None:
|
|
391
|
+
fx = self.fx
|
|
392
|
+
|
|
393
|
+
assert is_proper_subtype(fx.a, fx.a)
|
|
394
|
+
assert is_proper_subtype(fx.b, fx.a)
|
|
395
|
+
assert is_proper_subtype(fx.b, fx.o)
|
|
396
|
+
assert is_proper_subtype(fx.b, fx.o)
|
|
397
|
+
|
|
398
|
+
assert not is_proper_subtype(fx.a, fx.b)
|
|
399
|
+
assert not is_proper_subtype(fx.o, fx.b)
|
|
400
|
+
|
|
401
|
+
assert is_proper_subtype(fx.anyt, fx.anyt)
|
|
402
|
+
assert not is_proper_subtype(fx.a, fx.anyt)
|
|
403
|
+
assert not is_proper_subtype(fx.anyt, fx.a)
|
|
404
|
+
|
|
405
|
+
assert is_proper_subtype(fx.ga, fx.ga)
|
|
406
|
+
assert is_proper_subtype(fx.gdyn, fx.gdyn)
|
|
407
|
+
assert not is_proper_subtype(fx.ga, fx.gdyn)
|
|
408
|
+
assert not is_proper_subtype(fx.gdyn, fx.ga)
|
|
409
|
+
|
|
410
|
+
assert is_proper_subtype(fx.t, fx.t)
|
|
411
|
+
assert not is_proper_subtype(fx.t, fx.s)
|
|
412
|
+
|
|
413
|
+
assert is_proper_subtype(fx.a, UnionType([fx.a, fx.b]))
|
|
414
|
+
assert is_proper_subtype(UnionType([fx.a, fx.b]), UnionType([fx.a, fx.b, fx.c]))
|
|
415
|
+
assert not is_proper_subtype(UnionType([fx.a, fx.b]), UnionType([fx.b, fx.c]))
|
|
416
|
+
|
|
417
|
+
def test_is_proper_subtype_covariance(self) -> None:
|
|
418
|
+
fx_co = self.fx_co
|
|
419
|
+
|
|
420
|
+
assert is_proper_subtype(fx_co.gsab, fx_co.gb)
|
|
421
|
+
assert is_proper_subtype(fx_co.gsab, fx_co.ga)
|
|
422
|
+
assert not is_proper_subtype(fx_co.gsaa, fx_co.gb)
|
|
423
|
+
assert is_proper_subtype(fx_co.gb, fx_co.ga)
|
|
424
|
+
assert not is_proper_subtype(fx_co.ga, fx_co.gb)
|
|
425
|
+
|
|
426
|
+
def test_is_proper_subtype_contravariance(self) -> None:
|
|
427
|
+
fx_contra = self.fx_contra
|
|
428
|
+
|
|
429
|
+
assert is_proper_subtype(fx_contra.gsab, fx_contra.gb)
|
|
430
|
+
assert not is_proper_subtype(fx_contra.gsab, fx_contra.ga)
|
|
431
|
+
assert is_proper_subtype(fx_contra.gsaa, fx_contra.gb)
|
|
432
|
+
assert not is_proper_subtype(fx_contra.gb, fx_contra.ga)
|
|
433
|
+
assert is_proper_subtype(fx_contra.ga, fx_contra.gb)
|
|
434
|
+
|
|
435
|
+
def test_is_proper_subtype_invariance(self) -> None:
|
|
436
|
+
fx = self.fx
|
|
437
|
+
|
|
438
|
+
assert is_proper_subtype(fx.gsab, fx.gb)
|
|
439
|
+
assert not is_proper_subtype(fx.gsab, fx.ga)
|
|
440
|
+
assert not is_proper_subtype(fx.gsaa, fx.gb)
|
|
441
|
+
assert not is_proper_subtype(fx.gb, fx.ga)
|
|
442
|
+
assert not is_proper_subtype(fx.ga, fx.gb)
|
|
443
|
+
|
|
444
|
+
def test_is_proper_subtype_and_subtype_literal_types(self) -> None:
|
|
445
|
+
fx = self.fx
|
|
446
|
+
|
|
447
|
+
lit1 = fx.lit1
|
|
448
|
+
lit2 = fx.lit2
|
|
449
|
+
lit3 = fx.lit3
|
|
450
|
+
|
|
451
|
+
assert is_proper_subtype(lit1, fx.a)
|
|
452
|
+
assert not is_proper_subtype(lit1, fx.d)
|
|
453
|
+
assert not is_proper_subtype(fx.a, lit1)
|
|
454
|
+
assert is_proper_subtype(fx.uninhabited, lit1)
|
|
455
|
+
assert not is_proper_subtype(lit1, fx.uninhabited)
|
|
456
|
+
assert is_proper_subtype(lit1, lit1)
|
|
457
|
+
assert not is_proper_subtype(lit1, lit2)
|
|
458
|
+
assert not is_proper_subtype(lit2, lit3)
|
|
459
|
+
|
|
460
|
+
assert is_subtype(lit1, fx.a)
|
|
461
|
+
assert not is_subtype(lit1, fx.d)
|
|
462
|
+
assert not is_subtype(fx.a, lit1)
|
|
463
|
+
assert is_subtype(fx.uninhabited, lit1)
|
|
464
|
+
assert not is_subtype(lit1, fx.uninhabited)
|
|
465
|
+
assert is_subtype(lit1, lit1)
|
|
466
|
+
assert not is_subtype(lit1, lit2)
|
|
467
|
+
assert not is_subtype(lit2, lit3)
|
|
468
|
+
|
|
469
|
+
assert not is_proper_subtype(lit1, fx.anyt)
|
|
470
|
+
assert not is_proper_subtype(fx.anyt, lit1)
|
|
471
|
+
|
|
472
|
+
assert is_subtype(lit1, fx.anyt)
|
|
473
|
+
assert is_subtype(fx.anyt, lit1)
|
|
474
|
+
|
|
475
|
+
def test_subtype_aliases(self) -> None:
|
|
476
|
+
A1, _ = self.fx.def_alias_1(self.fx.a)
|
|
477
|
+
AA1, _ = self.fx.def_alias_1(self.fx.a)
|
|
478
|
+
assert is_subtype(A1, AA1)
|
|
479
|
+
assert is_subtype(AA1, A1)
|
|
480
|
+
|
|
481
|
+
A2, _ = self.fx.def_alias_2(self.fx.a)
|
|
482
|
+
AA2, _ = self.fx.def_alias_2(self.fx.a)
|
|
483
|
+
assert is_subtype(A2, AA2)
|
|
484
|
+
assert is_subtype(AA2, A2)
|
|
485
|
+
|
|
486
|
+
B1, _ = self.fx.def_alias_1(self.fx.b)
|
|
487
|
+
B2, _ = self.fx.def_alias_2(self.fx.b)
|
|
488
|
+
assert is_subtype(B1, A1)
|
|
489
|
+
assert is_subtype(B2, A2)
|
|
490
|
+
assert not is_subtype(A1, B1)
|
|
491
|
+
assert not is_subtype(A2, B2)
|
|
492
|
+
|
|
493
|
+
assert not is_subtype(A2, A1)
|
|
494
|
+
assert is_subtype(A1, A2)
|
|
495
|
+
|
|
496
|
+
# can_be_true / can_be_false
|
|
497
|
+
|
|
498
|
+
def test_empty_tuple_always_false(self) -> None:
|
|
499
|
+
tuple_type = self.tuple()
|
|
500
|
+
assert tuple_type.can_be_false
|
|
501
|
+
assert not tuple_type.can_be_true
|
|
502
|
+
|
|
503
|
+
def test_nonempty_tuple_always_true(self) -> None:
|
|
504
|
+
tuple_type = self.tuple(AnyType(TypeOfAny.special_form), AnyType(TypeOfAny.special_form))
|
|
505
|
+
assert tuple_type.can_be_true
|
|
506
|
+
assert not tuple_type.can_be_false
|
|
507
|
+
|
|
508
|
+
def test_union_can_be_true_if_any_true(self) -> None:
|
|
509
|
+
union_type = UnionType([self.fx.a, self.tuple()])
|
|
510
|
+
assert union_type.can_be_true
|
|
511
|
+
|
|
512
|
+
def test_union_can_not_be_true_if_none_true(self) -> None:
|
|
513
|
+
union_type = UnionType([self.tuple(), self.tuple()])
|
|
514
|
+
assert not union_type.can_be_true
|
|
515
|
+
|
|
516
|
+
def test_union_can_be_false_if_any_false(self) -> None:
|
|
517
|
+
union_type = UnionType([self.fx.a, self.tuple()])
|
|
518
|
+
assert union_type.can_be_false
|
|
519
|
+
|
|
520
|
+
def test_union_can_not_be_false_if_none_false(self) -> None:
|
|
521
|
+
union_type = UnionType([self.tuple(self.fx.a), self.tuple(self.fx.d)])
|
|
522
|
+
assert not union_type.can_be_false
|
|
523
|
+
|
|
524
|
+
# true_only / false_only
|
|
525
|
+
|
|
526
|
+
def test_true_only_of_false_type_is_uninhabited(self) -> None:
|
|
527
|
+
to = true_only(NoneType())
|
|
528
|
+
assert_type(UninhabitedType, to)
|
|
529
|
+
|
|
530
|
+
def test_true_only_of_true_type_is_idempotent(self) -> None:
|
|
531
|
+
always_true = self.tuple(AnyType(TypeOfAny.special_form))
|
|
532
|
+
to = true_only(always_true)
|
|
533
|
+
assert always_true is to
|
|
534
|
+
|
|
535
|
+
def test_true_only_of_instance(self) -> None:
|
|
536
|
+
to = true_only(self.fx.a)
|
|
537
|
+
assert_equal(str(to), "A")
|
|
538
|
+
assert to.can_be_true
|
|
539
|
+
assert not to.can_be_false
|
|
540
|
+
assert_type(Instance, to)
|
|
541
|
+
# The original class still can be false
|
|
542
|
+
assert self.fx.a.can_be_false
|
|
543
|
+
|
|
544
|
+
def test_true_only_of_union(self) -> None:
|
|
545
|
+
tup_type = self.tuple(AnyType(TypeOfAny.special_form))
|
|
546
|
+
# Union of something that is unknown, something that is always true, something
|
|
547
|
+
# that is always false
|
|
548
|
+
union_type = UnionType([self.fx.a, tup_type, self.tuple()])
|
|
549
|
+
to = true_only(union_type)
|
|
550
|
+
assert isinstance(to, UnionType)
|
|
551
|
+
assert_equal(len(to.items), 2)
|
|
552
|
+
assert to.items[0].can_be_true
|
|
553
|
+
assert not to.items[0].can_be_false
|
|
554
|
+
assert to.items[1] is tup_type
|
|
555
|
+
|
|
556
|
+
def test_false_only_of_true_type_is_uninhabited(self) -> None:
|
|
557
|
+
with state.strict_optional_set(True):
|
|
558
|
+
fo = false_only(self.tuple(AnyType(TypeOfAny.special_form)))
|
|
559
|
+
assert_type(UninhabitedType, fo)
|
|
560
|
+
|
|
561
|
+
def test_false_only_tuple(self) -> None:
|
|
562
|
+
with state.strict_optional_set(False):
|
|
563
|
+
fo = false_only(self.tuple(self.fx.a))
|
|
564
|
+
assert_equal(fo, NoneType())
|
|
565
|
+
with state.strict_optional_set(True):
|
|
566
|
+
fo = false_only(self.tuple(self.fx.a))
|
|
567
|
+
assert_equal(fo, UninhabitedType())
|
|
568
|
+
|
|
569
|
+
def test_false_only_of_false_type_is_idempotent(self) -> None:
|
|
570
|
+
always_false = NoneType()
|
|
571
|
+
fo = false_only(always_false)
|
|
572
|
+
assert always_false is fo
|
|
573
|
+
|
|
574
|
+
def test_false_only_of_instance(self) -> None:
|
|
575
|
+
fo = false_only(self.fx.a)
|
|
576
|
+
assert_equal(str(fo), "A")
|
|
577
|
+
assert not fo.can_be_true
|
|
578
|
+
assert fo.can_be_false
|
|
579
|
+
assert_type(Instance, fo)
|
|
580
|
+
# The original class still can be true
|
|
581
|
+
assert self.fx.a.can_be_true
|
|
582
|
+
|
|
583
|
+
def test_false_only_of_union(self) -> None:
|
|
584
|
+
with state.strict_optional_set(True):
|
|
585
|
+
tup_type = self.tuple()
|
|
586
|
+
# Union of something that is unknown, something that is always true, something
|
|
587
|
+
# that is always false
|
|
588
|
+
union_type = UnionType(
|
|
589
|
+
[self.fx.a, self.tuple(AnyType(TypeOfAny.special_form)), tup_type]
|
|
590
|
+
)
|
|
591
|
+
assert_equal(len(union_type.items), 3)
|
|
592
|
+
fo = false_only(union_type)
|
|
593
|
+
assert isinstance(fo, UnionType)
|
|
594
|
+
assert_equal(len(fo.items), 2)
|
|
595
|
+
assert not fo.items[0].can_be_true
|
|
596
|
+
assert fo.items[0].can_be_false
|
|
597
|
+
assert fo.items[1] is tup_type
|
|
598
|
+
|
|
599
|
+
def test_simplified_union(self) -> None:
|
|
600
|
+
fx = self.fx
|
|
601
|
+
|
|
602
|
+
self.assert_simplified_union([fx.a, fx.a], fx.a)
|
|
603
|
+
self.assert_simplified_union([fx.a, fx.b], fx.a)
|
|
604
|
+
self.assert_simplified_union([fx.a, fx.d], UnionType([fx.a, fx.d]))
|
|
605
|
+
self.assert_simplified_union([fx.a, fx.uninhabited], fx.a)
|
|
606
|
+
self.assert_simplified_union([fx.ga, fx.gs2a], fx.ga)
|
|
607
|
+
self.assert_simplified_union([fx.ga, fx.gsab], UnionType([fx.ga, fx.gsab]))
|
|
608
|
+
self.assert_simplified_union([fx.ga, fx.gsba], fx.ga)
|
|
609
|
+
self.assert_simplified_union([fx.a, UnionType([fx.d])], UnionType([fx.a, fx.d]))
|
|
610
|
+
self.assert_simplified_union([fx.a, UnionType([fx.a])], fx.a)
|
|
611
|
+
self.assert_simplified_union(
|
|
612
|
+
[fx.b, UnionType([fx.c, UnionType([fx.d])])], UnionType([fx.b, fx.c, fx.d])
|
|
613
|
+
)
|
|
614
|
+
|
|
615
|
+
def test_simplified_union_with_literals(self) -> None:
|
|
616
|
+
fx = self.fx
|
|
617
|
+
|
|
618
|
+
self.assert_simplified_union([fx.lit1, fx.a], fx.a)
|
|
619
|
+
self.assert_simplified_union([fx.lit1, fx.lit2, fx.a], fx.a)
|
|
620
|
+
self.assert_simplified_union([fx.lit1, fx.lit1], fx.lit1)
|
|
621
|
+
self.assert_simplified_union([fx.lit1, fx.lit2], UnionType([fx.lit1, fx.lit2]))
|
|
622
|
+
self.assert_simplified_union([fx.lit1, fx.lit3], UnionType([fx.lit1, fx.lit3]))
|
|
623
|
+
self.assert_simplified_union([fx.lit1, fx.uninhabited], fx.lit1)
|
|
624
|
+
self.assert_simplified_union([fx.lit1_inst, fx.a], fx.a)
|
|
625
|
+
self.assert_simplified_union([fx.lit1_inst, fx.lit1_inst], fx.lit1_inst)
|
|
626
|
+
self.assert_simplified_union(
|
|
627
|
+
[fx.lit1_inst, fx.lit2_inst], UnionType([fx.lit1_inst, fx.lit2_inst])
|
|
628
|
+
)
|
|
629
|
+
self.assert_simplified_union(
|
|
630
|
+
[fx.lit1_inst, fx.lit3_inst], UnionType([fx.lit1_inst, fx.lit3_inst])
|
|
631
|
+
)
|
|
632
|
+
self.assert_simplified_union([fx.lit1_inst, fx.uninhabited], fx.lit1_inst)
|
|
633
|
+
self.assert_simplified_union([fx.lit1, fx.lit1_inst], fx.lit1)
|
|
634
|
+
self.assert_simplified_union([fx.lit1, fx.lit2_inst], UnionType([fx.lit1, fx.lit2_inst]))
|
|
635
|
+
self.assert_simplified_union([fx.lit1, fx.lit3_inst], UnionType([fx.lit1, fx.lit3_inst]))
|
|
636
|
+
|
|
637
|
+
def test_simplified_union_with_str_literals(self) -> None:
|
|
638
|
+
fx = self.fx
|
|
639
|
+
|
|
640
|
+
self.assert_simplified_union([fx.lit_str1, fx.lit_str2, fx.str_type], fx.str_type)
|
|
641
|
+
self.assert_simplified_union([fx.lit_str1, fx.lit_str1, fx.lit_str1], fx.lit_str1)
|
|
642
|
+
self.assert_simplified_union(
|
|
643
|
+
[fx.lit_str1, fx.lit_str2, fx.lit_str3],
|
|
644
|
+
UnionType([fx.lit_str1, fx.lit_str2, fx.lit_str3]),
|
|
645
|
+
)
|
|
646
|
+
self.assert_simplified_union(
|
|
647
|
+
[fx.lit_str1, fx.lit_str2, fx.uninhabited], UnionType([fx.lit_str1, fx.lit_str2])
|
|
648
|
+
)
|
|
649
|
+
|
|
650
|
+
def test_simplify_very_large_union(self) -> None:
|
|
651
|
+
fx = self.fx
|
|
652
|
+
literals = []
|
|
653
|
+
for i in range(5000):
|
|
654
|
+
literals.append(LiteralType("v%d" % i, fx.str_type))
|
|
655
|
+
# This shouldn't be very slow, even if the union is big.
|
|
656
|
+
self.assert_simplified_union([*literals, fx.str_type], fx.str_type)
|
|
657
|
+
|
|
658
|
+
def test_simplified_union_with_str_instance_literals(self) -> None:
|
|
659
|
+
fx = self.fx
|
|
660
|
+
|
|
661
|
+
self.assert_simplified_union(
|
|
662
|
+
[fx.lit_str1_inst, fx.lit_str2_inst, fx.str_type], fx.str_type
|
|
663
|
+
)
|
|
664
|
+
self.assert_simplified_union(
|
|
665
|
+
[fx.lit_str1_inst, fx.lit_str1_inst, fx.lit_str1_inst], fx.lit_str1_inst
|
|
666
|
+
)
|
|
667
|
+
self.assert_simplified_union(
|
|
668
|
+
[fx.lit_str1_inst, fx.lit_str2_inst, fx.lit_str3_inst],
|
|
669
|
+
UnionType([fx.lit_str1_inst, fx.lit_str2_inst, fx.lit_str3_inst]),
|
|
670
|
+
)
|
|
671
|
+
self.assert_simplified_union(
|
|
672
|
+
[fx.lit_str1_inst, fx.lit_str2_inst, fx.uninhabited],
|
|
673
|
+
UnionType([fx.lit_str1_inst, fx.lit_str2_inst]),
|
|
674
|
+
)
|
|
675
|
+
|
|
676
|
+
def test_simplified_union_with_mixed_str_literals(self) -> None:
|
|
677
|
+
fx = self.fx
|
|
678
|
+
|
|
679
|
+
self.assert_simplified_union(
|
|
680
|
+
[fx.lit_str1, fx.lit_str2, fx.lit_str3_inst],
|
|
681
|
+
UnionType([fx.lit_str1, fx.lit_str2, fx.lit_str3_inst]),
|
|
682
|
+
)
|
|
683
|
+
self.assert_simplified_union([fx.lit_str1, fx.lit_str1, fx.lit_str1_inst], fx.lit_str1)
|
|
684
|
+
|
|
685
|
+
def assert_simplified_union(self, original: list[Type], union: Type) -> None:
|
|
686
|
+
assert_equal(make_simplified_union(original), union)
|
|
687
|
+
assert_equal(make_simplified_union(list(reversed(original))), union)
|
|
688
|
+
|
|
689
|
+
def test_generic_callable_overlap_is_symmetric(self) -> None:
|
|
690
|
+
any_type = AnyType(TypeOfAny.from_omitted_generics)
|
|
691
|
+
outer_t = TypeVarType("T", "T", TypeVarId(1), [], self.fx.o, any_type)
|
|
692
|
+
outer_s = TypeVarType("S", "S", TypeVarId(2), [], self.fx.o, any_type)
|
|
693
|
+
generic_t = TypeVarType("T", "T", TypeVarId(-1), [], self.fx.o, any_type)
|
|
694
|
+
|
|
695
|
+
callable_type = CallableType([outer_t], [ARG_POS], [None], outer_s, self.fx.function)
|
|
696
|
+
generic_identity = CallableType(
|
|
697
|
+
[generic_t], [ARG_POS], [None], generic_t, self.fx.function, variables=[generic_t]
|
|
698
|
+
)
|
|
699
|
+
|
|
700
|
+
assert is_overlapping_types(callable_type, generic_identity)
|
|
701
|
+
assert is_overlapping_types(generic_identity, callable_type)
|
|
702
|
+
|
|
703
|
+
# Helpers
|
|
704
|
+
|
|
705
|
+
def tuple(self, *a: Type) -> TupleType:
|
|
706
|
+
return TupleType(list(a), self.fx.std_tuple)
|
|
707
|
+
|
|
708
|
+
def callable(self, vars: list[str], *a: Type) -> CallableType:
|
|
709
|
+
"""callable(args, a1, ..., an, r) constructs a callable with
|
|
710
|
+
argument types a1, ... an and return type r and type arguments
|
|
711
|
+
vars.
|
|
712
|
+
"""
|
|
713
|
+
tv: list[TypeVarType] = []
|
|
714
|
+
n = -1
|
|
715
|
+
for v in vars:
|
|
716
|
+
tv.append(
|
|
717
|
+
TypeVarType(
|
|
718
|
+
v, v, TypeVarId(n), [], self.fx.o, AnyType(TypeOfAny.from_omitted_generics)
|
|
719
|
+
)
|
|
720
|
+
)
|
|
721
|
+
n -= 1
|
|
722
|
+
return CallableType(
|
|
723
|
+
list(a[:-1]),
|
|
724
|
+
[ARG_POS] * (len(a) - 1),
|
|
725
|
+
[None] * (len(a) - 1),
|
|
726
|
+
a[-1],
|
|
727
|
+
self.fx.function,
|
|
728
|
+
name=None,
|
|
729
|
+
variables=tv,
|
|
730
|
+
)
|
|
731
|
+
|
|
732
|
+
|
|
733
|
+
class JoinSuite(Suite):
|
|
734
|
+
def setUp(self) -> None:
|
|
735
|
+
self.fx = TypeFixture(INVARIANT)
|
|
736
|
+
self.fx_co = TypeFixture(COVARIANT)
|
|
737
|
+
self.fx_contra = TypeFixture(CONTRAVARIANT)
|
|
738
|
+
|
|
739
|
+
def test_trivial_cases(self) -> None:
|
|
740
|
+
for simple in self.fx.a, self.fx.o, self.fx.b:
|
|
741
|
+
self.assert_join(simple, simple, simple)
|
|
742
|
+
|
|
743
|
+
def test_class_subtyping(self) -> None:
|
|
744
|
+
self.assert_join(self.fx.a, self.fx.o, self.fx.o)
|
|
745
|
+
self.assert_join(self.fx.b, self.fx.o, self.fx.o)
|
|
746
|
+
self.assert_join(self.fx.a, self.fx.d, self.fx.o)
|
|
747
|
+
self.assert_join(self.fx.b, self.fx.c, self.fx.a)
|
|
748
|
+
self.assert_join(self.fx.b, self.fx.d, self.fx.o)
|
|
749
|
+
|
|
750
|
+
def test_tuples(self) -> None:
|
|
751
|
+
self.assert_join(self.tuple(), self.tuple(), self.tuple())
|
|
752
|
+
self.assert_join(self.tuple(self.fx.a), self.tuple(self.fx.a), self.tuple(self.fx.a))
|
|
753
|
+
self.assert_join(
|
|
754
|
+
self.tuple(self.fx.b, self.fx.c),
|
|
755
|
+
self.tuple(self.fx.a, self.fx.d),
|
|
756
|
+
self.tuple(self.fx.a, self.fx.o),
|
|
757
|
+
)
|
|
758
|
+
|
|
759
|
+
self.assert_join(
|
|
760
|
+
self.tuple(self.fx.a, self.fx.a), self.fx.std_tuple, self.var_tuple(self.fx.anyt)
|
|
761
|
+
)
|
|
762
|
+
self.assert_join(
|
|
763
|
+
self.tuple(self.fx.a), self.tuple(self.fx.a, self.fx.a), self.var_tuple(self.fx.a)
|
|
764
|
+
)
|
|
765
|
+
self.assert_join(
|
|
766
|
+
self.tuple(self.fx.b), self.tuple(self.fx.a, self.fx.c), self.var_tuple(self.fx.a)
|
|
767
|
+
)
|
|
768
|
+
self.assert_join(self.tuple(), self.tuple(self.fx.a), self.var_tuple(self.fx.a))
|
|
769
|
+
|
|
770
|
+
def test_var_tuples(self) -> None:
|
|
771
|
+
self.assert_join(
|
|
772
|
+
self.tuple(self.fx.a), self.var_tuple(self.fx.a), self.var_tuple(self.fx.a)
|
|
773
|
+
)
|
|
774
|
+
self.assert_join(
|
|
775
|
+
self.var_tuple(self.fx.a), self.tuple(self.fx.a), self.var_tuple(self.fx.a)
|
|
776
|
+
)
|
|
777
|
+
self.assert_join(self.var_tuple(self.fx.a), self.tuple(), self.var_tuple(self.fx.a))
|
|
778
|
+
|
|
779
|
+
def test_function_types(self) -> None:
|
|
780
|
+
self.assert_join(
|
|
781
|
+
self.callable(self.fx.a, self.fx.b),
|
|
782
|
+
self.callable(self.fx.a, self.fx.b),
|
|
783
|
+
self.callable(self.fx.a, self.fx.b),
|
|
784
|
+
)
|
|
785
|
+
|
|
786
|
+
self.assert_join(
|
|
787
|
+
self.callable(self.fx.a, self.fx.b),
|
|
788
|
+
self.callable(self.fx.b, self.fx.b),
|
|
789
|
+
self.callable(self.fx.b, self.fx.b),
|
|
790
|
+
)
|
|
791
|
+
self.assert_join(
|
|
792
|
+
self.callable(self.fx.a, self.fx.b),
|
|
793
|
+
self.callable(self.fx.a, self.fx.a),
|
|
794
|
+
self.callable(self.fx.a, self.fx.a),
|
|
795
|
+
)
|
|
796
|
+
self.assert_join(self.callable(self.fx.a, self.fx.b), self.fx.function, self.fx.function)
|
|
797
|
+
self.assert_join(
|
|
798
|
+
self.callable(self.fx.a, self.fx.b),
|
|
799
|
+
self.callable(self.fx.d, self.fx.b),
|
|
800
|
+
self.fx.function,
|
|
801
|
+
)
|
|
802
|
+
|
|
803
|
+
def test_type_vars(self) -> None:
|
|
804
|
+
self.assert_join(self.fx.t, self.fx.t, self.fx.t)
|
|
805
|
+
self.assert_join(self.fx.s, self.fx.s, self.fx.s)
|
|
806
|
+
self.assert_join(self.fx.t, self.fx.s, self.fx.o)
|
|
807
|
+
|
|
808
|
+
def test_none(self) -> None:
|
|
809
|
+
with state.strict_optional_set(False):
|
|
810
|
+
# Any type t joined with None results in t.
|
|
811
|
+
for t in [
|
|
812
|
+
NoneType(),
|
|
813
|
+
self.fx.a,
|
|
814
|
+
self.fx.o,
|
|
815
|
+
UnboundType("x"),
|
|
816
|
+
self.fx.t,
|
|
817
|
+
self.tuple(),
|
|
818
|
+
self.callable(self.fx.a, self.fx.b),
|
|
819
|
+
self.fx.anyt,
|
|
820
|
+
]:
|
|
821
|
+
self.assert_join(t, NoneType(), t)
|
|
822
|
+
|
|
823
|
+
def test_unbound_type(self) -> None:
|
|
824
|
+
self.assert_join(UnboundType("x"), UnboundType("x"), self.fx.anyt)
|
|
825
|
+
self.assert_join(UnboundType("x"), UnboundType("y"), self.fx.anyt)
|
|
826
|
+
|
|
827
|
+
# Any type t joined with an unbound type results in dynamic. Unbound
|
|
828
|
+
# type means that there is an error somewhere in the program, so this
|
|
829
|
+
# does not affect type safety (whatever the result).
|
|
830
|
+
for t in [
|
|
831
|
+
self.fx.a,
|
|
832
|
+
self.fx.o,
|
|
833
|
+
self.fx.ga,
|
|
834
|
+
self.fx.t,
|
|
835
|
+
self.tuple(),
|
|
836
|
+
self.callable(self.fx.a, self.fx.b),
|
|
837
|
+
]:
|
|
838
|
+
self.assert_join(t, UnboundType("X"), self.fx.anyt)
|
|
839
|
+
|
|
840
|
+
def test_any_type(self) -> None:
|
|
841
|
+
# Join against 'Any' type always results in 'Any'.
|
|
842
|
+
with state.strict_optional_set(False):
|
|
843
|
+
self.assert_join(NoneType(), self.fx.anyt, self.fx.anyt)
|
|
844
|
+
|
|
845
|
+
for t in [
|
|
846
|
+
self.fx.anyt,
|
|
847
|
+
self.fx.a,
|
|
848
|
+
self.fx.o,
|
|
849
|
+
NoneType(),
|
|
850
|
+
UnboundType("x"),
|
|
851
|
+
self.fx.t,
|
|
852
|
+
self.tuple(),
|
|
853
|
+
self.callable(self.fx.a, self.fx.b),
|
|
854
|
+
]:
|
|
855
|
+
self.assert_join(t, self.fx.anyt, self.fx.anyt)
|
|
856
|
+
|
|
857
|
+
def test_mixed_truth_restricted_type_simple(self) -> None:
|
|
858
|
+
# make_simplified_union against differently restricted truthiness types drops restrictions.
|
|
859
|
+
true_a = true_only(self.fx.a)
|
|
860
|
+
false_o = false_only(self.fx.o)
|
|
861
|
+
u = make_simplified_union([true_a, false_o])
|
|
862
|
+
assert u.can_be_true
|
|
863
|
+
assert u.can_be_false
|
|
864
|
+
|
|
865
|
+
def test_mixed_truth_restricted_type(self) -> None:
|
|
866
|
+
# join_types against differently restricted truthiness types drops restrictions.
|
|
867
|
+
true_any = true_only(AnyType(TypeOfAny.special_form))
|
|
868
|
+
false_o = false_only(self.fx.o)
|
|
869
|
+
j = join_types(true_any, false_o)
|
|
870
|
+
assert j.can_be_true
|
|
871
|
+
assert j.can_be_false
|
|
872
|
+
|
|
873
|
+
def test_other_mixed_types(self) -> None:
|
|
874
|
+
# In general, joining unrelated types produces object.
|
|
875
|
+
for t1 in [self.fx.a, self.fx.t, self.tuple(), self.callable(self.fx.a, self.fx.b)]:
|
|
876
|
+
for t2 in [self.fx.a, self.fx.t, self.tuple(), self.callable(self.fx.a, self.fx.b)]:
|
|
877
|
+
if str(t1) != str(t2):
|
|
878
|
+
self.assert_join(t1, t2, self.fx.o)
|
|
879
|
+
|
|
880
|
+
def test_simple_generics(self) -> None:
|
|
881
|
+
with state.strict_optional_set(False):
|
|
882
|
+
self.assert_join(self.fx.ga, self.fx.nonet, self.fx.ga)
|
|
883
|
+
with state.strict_optional_set(True):
|
|
884
|
+
self.assert_join(self.fx.ga, self.fx.nonet, UnionType([self.fx.ga, NoneType()]))
|
|
885
|
+
|
|
886
|
+
self.assert_join(self.fx.ga, self.fx.anyt, self.fx.anyt)
|
|
887
|
+
|
|
888
|
+
for t in [
|
|
889
|
+
self.fx.a,
|
|
890
|
+
self.fx.o,
|
|
891
|
+
self.fx.t,
|
|
892
|
+
self.tuple(),
|
|
893
|
+
self.callable(self.fx.a, self.fx.b),
|
|
894
|
+
]:
|
|
895
|
+
self.assert_join(t, self.fx.ga, self.fx.o)
|
|
896
|
+
|
|
897
|
+
def test_generics_invariant(self) -> None:
|
|
898
|
+
self.assert_join(self.fx.ga, self.fx.ga, self.fx.ga)
|
|
899
|
+
self.assert_join(self.fx.ga, self.fx.gb, self.fx.o)
|
|
900
|
+
self.assert_join(self.fx.ga, self.fx.gd, self.fx.o)
|
|
901
|
+
self.assert_join(self.fx.ga, self.fx.g2a, self.fx.o)
|
|
902
|
+
|
|
903
|
+
def test_generics_covariant(self) -> None:
|
|
904
|
+
self.assert_join(self.fx_co.ga, self.fx_co.ga, self.fx_co.ga)
|
|
905
|
+
self.assert_join(self.fx_co.ga, self.fx_co.gb, self.fx_co.ga)
|
|
906
|
+
self.assert_join(self.fx_co.ga, self.fx_co.gd, self.fx_co.go)
|
|
907
|
+
self.assert_join(self.fx_co.ga, self.fx_co.g2a, self.fx_co.o)
|
|
908
|
+
|
|
909
|
+
def test_generics_contravariant(self) -> None:
|
|
910
|
+
self.assert_join(self.fx_contra.ga, self.fx_contra.ga, self.fx_contra.ga)
|
|
911
|
+
# TODO: this can be more precise than "object", see a comment in mypy/join.py
|
|
912
|
+
self.assert_join(self.fx_contra.ga, self.fx_contra.gb, self.fx_contra.o)
|
|
913
|
+
self.assert_join(self.fx_contra.ga, self.fx_contra.g2a, self.fx_contra.o)
|
|
914
|
+
|
|
915
|
+
def test_generics_with_multiple_args(self) -> None:
|
|
916
|
+
self.assert_join(self.fx_co.hab, self.fx_co.hab, self.fx_co.hab)
|
|
917
|
+
self.assert_join(self.fx_co.hab, self.fx_co.hbb, self.fx_co.hab)
|
|
918
|
+
self.assert_join(self.fx_co.had, self.fx_co.haa, self.fx_co.hao)
|
|
919
|
+
|
|
920
|
+
def test_generics_with_inheritance(self) -> None:
|
|
921
|
+
self.assert_join(self.fx_co.gsab, self.fx_co.gb, self.fx_co.gb)
|
|
922
|
+
self.assert_join(self.fx_co.gsba, self.fx_co.gb, self.fx_co.ga)
|
|
923
|
+
self.assert_join(self.fx_co.gsab, self.fx_co.gd, self.fx_co.go)
|
|
924
|
+
|
|
925
|
+
def test_generics_with_inheritance_and_shared_supertype(self) -> None:
|
|
926
|
+
self.assert_join(self.fx_co.gsba, self.fx_co.gs2a, self.fx_co.ga)
|
|
927
|
+
self.assert_join(self.fx_co.gsab, self.fx_co.gs2a, self.fx_co.ga)
|
|
928
|
+
self.assert_join(self.fx_co.gsab, self.fx_co.gs2d, self.fx_co.go)
|
|
929
|
+
|
|
930
|
+
def test_generic_types_and_any(self) -> None:
|
|
931
|
+
self.assert_join(self.fx.gdyn, self.fx.ga, self.fx.gdyn)
|
|
932
|
+
self.assert_join(self.fx_co.gdyn, self.fx_co.ga, self.fx_co.gdyn)
|
|
933
|
+
self.assert_join(self.fx_contra.gdyn, self.fx_contra.ga, self.fx_contra.gdyn)
|
|
934
|
+
|
|
935
|
+
def test_callables_with_any(self) -> None:
|
|
936
|
+
self.assert_join(
|
|
937
|
+
self.callable(self.fx.a, self.fx.a, self.fx.anyt, self.fx.a),
|
|
938
|
+
self.callable(self.fx.a, self.fx.anyt, self.fx.a, self.fx.anyt),
|
|
939
|
+
self.callable(self.fx.a, self.fx.anyt, self.fx.anyt, self.fx.anyt),
|
|
940
|
+
)
|
|
941
|
+
|
|
942
|
+
def test_overloaded(self) -> None:
|
|
943
|
+
c = self.callable
|
|
944
|
+
|
|
945
|
+
def ov(*items: CallableType) -> Overloaded:
|
|
946
|
+
return Overloaded(list(items))
|
|
947
|
+
|
|
948
|
+
fx = self.fx
|
|
949
|
+
func = fx.function
|
|
950
|
+
c1 = c(fx.a, fx.a)
|
|
951
|
+
c2 = c(fx.b, fx.b)
|
|
952
|
+
c3 = c(fx.c, fx.c)
|
|
953
|
+
self.assert_join(ov(c1, c2), c1, c1)
|
|
954
|
+
self.assert_join(ov(c1, c2), c2, c2)
|
|
955
|
+
self.assert_join(ov(c1, c2), ov(c1, c2), ov(c1, c2))
|
|
956
|
+
self.assert_join(ov(c1, c2), ov(c1, c3), c1)
|
|
957
|
+
self.assert_join(ov(c2, c1), ov(c3, c1), c1)
|
|
958
|
+
self.assert_join(ov(c1, c2), c3, func)
|
|
959
|
+
|
|
960
|
+
def test_overloaded_with_any(self) -> None:
|
|
961
|
+
c = self.callable
|
|
962
|
+
|
|
963
|
+
def ov(*items: CallableType) -> Overloaded:
|
|
964
|
+
return Overloaded(list(items))
|
|
965
|
+
|
|
966
|
+
fx = self.fx
|
|
967
|
+
any = fx.anyt
|
|
968
|
+
self.assert_join(ov(c(fx.a, fx.a), c(fx.b, fx.b)), c(any, fx.b), c(any, fx.b))
|
|
969
|
+
self.assert_join(ov(c(fx.a, fx.a), c(any, fx.b)), c(fx.b, fx.b), c(any, fx.b))
|
|
970
|
+
|
|
971
|
+
def test_join_interface_types(self) -> None:
|
|
972
|
+
self.assert_join(self.fx.f, self.fx.f, self.fx.f)
|
|
973
|
+
self.assert_join(self.fx.f, self.fx.f2, self.fx.o)
|
|
974
|
+
self.assert_join(self.fx.f, self.fx.f3, self.fx.f)
|
|
975
|
+
|
|
976
|
+
def test_join_interface_and_class_types(self) -> None:
|
|
977
|
+
self.assert_join(self.fx.o, self.fx.f, self.fx.o)
|
|
978
|
+
self.assert_join(self.fx.a, self.fx.f, self.fx.o)
|
|
979
|
+
|
|
980
|
+
self.assert_join(self.fx.e, self.fx.f, self.fx.f)
|
|
981
|
+
|
|
982
|
+
@skip
|
|
983
|
+
def test_join_class_types_with_interface_result(self) -> None:
|
|
984
|
+
# Unique result
|
|
985
|
+
self.assert_join(self.fx.e, self.fx.e2, self.fx.f)
|
|
986
|
+
|
|
987
|
+
# Ambiguous result
|
|
988
|
+
self.assert_join(self.fx.e2, self.fx.e3, self.fx.anyt)
|
|
989
|
+
|
|
990
|
+
@skip
|
|
991
|
+
def test_generic_interfaces(self) -> None:
|
|
992
|
+
fx = InterfaceTypeFixture()
|
|
993
|
+
|
|
994
|
+
self.assert_join(fx.gfa, fx.gfa, fx.gfa)
|
|
995
|
+
self.assert_join(fx.gfa, fx.gfb, fx.o)
|
|
996
|
+
|
|
997
|
+
self.assert_join(fx.m1, fx.gfa, fx.gfa)
|
|
998
|
+
|
|
999
|
+
self.assert_join(fx.m1, fx.gfb, fx.o)
|
|
1000
|
+
|
|
1001
|
+
def test_simple_type_objects(self) -> None:
|
|
1002
|
+
t1 = self.type_callable(self.fx.a, self.fx.a)
|
|
1003
|
+
t2 = self.type_callable(self.fx.b, self.fx.b)
|
|
1004
|
+
tr = self.type_callable(self.fx.b, self.fx.a)
|
|
1005
|
+
|
|
1006
|
+
self.assert_join(t1, t1, t1)
|
|
1007
|
+
j = join_types(t1, t1)
|
|
1008
|
+
assert isinstance(j, CallableType)
|
|
1009
|
+
assert j.is_type_obj()
|
|
1010
|
+
|
|
1011
|
+
self.assert_join(t1, t2, tr)
|
|
1012
|
+
self.assert_join(t1, self.fx.type_type, self.fx.type_type)
|
|
1013
|
+
self.assert_join(self.fx.type_type, self.fx.type_type, self.fx.type_type)
|
|
1014
|
+
|
|
1015
|
+
def test_type_type(self) -> None:
|
|
1016
|
+
self.assert_join(self.fx.type_a, self.fx.type_b, self.fx.type_a)
|
|
1017
|
+
self.assert_join(self.fx.type_b, self.fx.type_any, self.fx.type_any)
|
|
1018
|
+
self.assert_join(self.fx.type_b, self.fx.type_type, self.fx.type_type)
|
|
1019
|
+
self.assert_join(self.fx.type_b, self.fx.type_c, self.fx.type_a)
|
|
1020
|
+
self.assert_join(self.fx.type_c, self.fx.type_d, TypeType.make_normalized(self.fx.o))
|
|
1021
|
+
self.assert_join(self.fx.type_type, self.fx.type_any, self.fx.type_type)
|
|
1022
|
+
self.assert_join(self.fx.type_b, self.fx.anyt, self.fx.anyt)
|
|
1023
|
+
|
|
1024
|
+
def test_literal_type(self) -> None:
|
|
1025
|
+
a = self.fx.a
|
|
1026
|
+
d = self.fx.d
|
|
1027
|
+
lit1 = self.fx.lit1
|
|
1028
|
+
lit2 = self.fx.lit2
|
|
1029
|
+
lit3 = self.fx.lit3
|
|
1030
|
+
|
|
1031
|
+
self.assert_join(lit1, lit1, lit1)
|
|
1032
|
+
self.assert_join(lit1, a, a)
|
|
1033
|
+
self.assert_join(lit1, d, self.fx.o)
|
|
1034
|
+
self.assert_join(lit1, lit2, a)
|
|
1035
|
+
self.assert_join(lit1, lit3, self.fx.o)
|
|
1036
|
+
self.assert_join(lit1, self.fx.anyt, self.fx.anyt)
|
|
1037
|
+
self.assert_join(UnionType([lit1, lit2]), lit2, UnionType([lit1, lit2]))
|
|
1038
|
+
self.assert_join(UnionType([lit1, lit2]), a, a)
|
|
1039
|
+
self.assert_join(UnionType([lit1, lit3]), a, UnionType([a, lit3]))
|
|
1040
|
+
self.assert_join(UnionType([d, lit3]), lit3, d)
|
|
1041
|
+
self.assert_join(UnionType([d, lit3]), d, UnionType([d, lit3]))
|
|
1042
|
+
self.assert_join(UnionType([a, lit1]), lit1, a)
|
|
1043
|
+
self.assert_join(UnionType([a, lit1]), lit2, a)
|
|
1044
|
+
self.assert_join(UnionType([lit1, lit2]), UnionType([lit1, lit2]), UnionType([lit1, lit2]))
|
|
1045
|
+
|
|
1046
|
+
# The order in which we try joining two unions influences the
|
|
1047
|
+
# ordering of the items in the final produced unions. So, we
|
|
1048
|
+
# manually call 'assert_simple_join' and tune the output
|
|
1049
|
+
# after swapping the arguments here.
|
|
1050
|
+
self.assert_simple_join(
|
|
1051
|
+
UnionType([lit1, lit2]), UnionType([lit2, lit3]), UnionType([lit1, lit2, lit3])
|
|
1052
|
+
)
|
|
1053
|
+
self.assert_simple_join(
|
|
1054
|
+
UnionType([lit2, lit3]), UnionType([lit1, lit2]), UnionType([lit2, lit3, lit1])
|
|
1055
|
+
)
|
|
1056
|
+
|
|
1057
|
+
def test_variadic_tuple_joins(self) -> None:
|
|
1058
|
+
# These tests really test just the "arity", to be sure it is handled correctly.
|
|
1059
|
+
self.assert_join(
|
|
1060
|
+
self.tuple(self.fx.a, self.fx.a),
|
|
1061
|
+
self.tuple(UnpackType(Instance(self.fx.std_tuplei, [self.fx.a]))),
|
|
1062
|
+
Instance(self.fx.std_tuplei, [self.fx.a]),
|
|
1063
|
+
)
|
|
1064
|
+
self.assert_join(
|
|
1065
|
+
self.tuple(self.fx.a, self.fx.a),
|
|
1066
|
+
self.tuple(UnpackType(Instance(self.fx.std_tuplei, [self.fx.a])), self.fx.a),
|
|
1067
|
+
self.tuple(UnpackType(Instance(self.fx.std_tuplei, [self.fx.a])), self.fx.a),
|
|
1068
|
+
)
|
|
1069
|
+
self.assert_join(
|
|
1070
|
+
self.tuple(self.fx.a, self.fx.a),
|
|
1071
|
+
self.tuple(self.fx.a, UnpackType(Instance(self.fx.std_tuplei, [self.fx.a]))),
|
|
1072
|
+
self.tuple(self.fx.a, UnpackType(Instance(self.fx.std_tuplei, [self.fx.a]))),
|
|
1073
|
+
)
|
|
1074
|
+
self.assert_join(
|
|
1075
|
+
self.tuple(
|
|
1076
|
+
self.fx.a, UnpackType(Instance(self.fx.std_tuplei, [self.fx.a])), self.fx.a
|
|
1077
|
+
),
|
|
1078
|
+
self.tuple(
|
|
1079
|
+
self.fx.a, UnpackType(Instance(self.fx.std_tuplei, [self.fx.a])), self.fx.a
|
|
1080
|
+
),
|
|
1081
|
+
self.tuple(
|
|
1082
|
+
self.fx.a, UnpackType(Instance(self.fx.std_tuplei, [self.fx.a])), self.fx.a
|
|
1083
|
+
),
|
|
1084
|
+
)
|
|
1085
|
+
self.assert_join(
|
|
1086
|
+
self.tuple(UnpackType(Instance(self.fx.std_tuplei, [self.fx.a]))),
|
|
1087
|
+
self.tuple(
|
|
1088
|
+
self.fx.a, UnpackType(Instance(self.fx.std_tuplei, [self.fx.a])), self.fx.a
|
|
1089
|
+
),
|
|
1090
|
+
Instance(self.fx.std_tuplei, [self.fx.a]),
|
|
1091
|
+
)
|
|
1092
|
+
self.assert_join(
|
|
1093
|
+
self.tuple(UnpackType(Instance(self.fx.std_tuplei, [self.fx.a]))),
|
|
1094
|
+
self.tuple(UnpackType(Instance(self.fx.std_tuplei, [self.fx.a]))),
|
|
1095
|
+
Instance(self.fx.std_tuplei, [self.fx.a]),
|
|
1096
|
+
)
|
|
1097
|
+
self.assert_join(
|
|
1098
|
+
self.tuple(UnpackType(Instance(self.fx.std_tuplei, [self.fx.a])), self.fx.a),
|
|
1099
|
+
self.tuple(
|
|
1100
|
+
self.fx.b, UnpackType(Instance(self.fx.std_tuplei, [self.fx.b])), self.fx.b
|
|
1101
|
+
),
|
|
1102
|
+
self.tuple(UnpackType(Instance(self.fx.std_tuplei, [self.fx.a])), self.fx.a),
|
|
1103
|
+
)
|
|
1104
|
+
|
|
1105
|
+
def test_join_type_type_type_var(self) -> None:
|
|
1106
|
+
self.assert_join(self.fx.type_a, self.fx.t, self.fx.o)
|
|
1107
|
+
self.assert_join(self.fx.t, self.fx.type_a, self.fx.o)
|
|
1108
|
+
|
|
1109
|
+
def test_join_type_var_bounds(self) -> None:
|
|
1110
|
+
tvar1 = TypeVarType(
|
|
1111
|
+
"tvar1",
|
|
1112
|
+
"tvar1",
|
|
1113
|
+
TypeVarId(-100),
|
|
1114
|
+
[],
|
|
1115
|
+
self.fx.o,
|
|
1116
|
+
AnyType(TypeOfAny.from_omitted_generics),
|
|
1117
|
+
INVARIANT,
|
|
1118
|
+
)
|
|
1119
|
+
any_type = AnyType(TypeOfAny.special_form)
|
|
1120
|
+
tvar2 = TypeVarType(
|
|
1121
|
+
"tvar2",
|
|
1122
|
+
"tvar2",
|
|
1123
|
+
TypeVarId(-101),
|
|
1124
|
+
[],
|
|
1125
|
+
upper_bound=UnionType(
|
|
1126
|
+
[
|
|
1127
|
+
TupleType([any_type], self.fx.std_tuple),
|
|
1128
|
+
TupleType([any_type, any_type], self.fx.std_tuple),
|
|
1129
|
+
]
|
|
1130
|
+
),
|
|
1131
|
+
default=AnyType(TypeOfAny.from_omitted_generics),
|
|
1132
|
+
variance=INVARIANT,
|
|
1133
|
+
)
|
|
1134
|
+
|
|
1135
|
+
self.assert_join(tvar1, tvar2, self.fx.o)
|
|
1136
|
+
self.assert_join(tvar2, tvar1, self.fx.o)
|
|
1137
|
+
|
|
1138
|
+
# There are additional test cases in check-inference.test.
|
|
1139
|
+
|
|
1140
|
+
# TODO: Function types + varargs and default args.
|
|
1141
|
+
|
|
1142
|
+
def assert_join(self, s: Type, t: Type, join: Type) -> None:
|
|
1143
|
+
self.assert_simple_join(s, t, join)
|
|
1144
|
+
self.assert_simple_join(t, s, join)
|
|
1145
|
+
|
|
1146
|
+
def assert_simple_join(self, s: Type, t: Type, join: Type) -> None:
|
|
1147
|
+
result = join_types(s, t)
|
|
1148
|
+
actual = str(result)
|
|
1149
|
+
expected = str(join)
|
|
1150
|
+
assert_equal(actual, expected, f"join({s}, {t}) == {{}} ({{}} expected)")
|
|
1151
|
+
assert is_subtype(s, result), f"{s} not subtype of {result}"
|
|
1152
|
+
assert is_subtype(t, result), f"{t} not subtype of {result}"
|
|
1153
|
+
|
|
1154
|
+
def tuple(self, *a: Type) -> TupleType:
|
|
1155
|
+
return TupleType(list(a), self.fx.std_tuple)
|
|
1156
|
+
|
|
1157
|
+
def var_tuple(self, t: Type) -> Instance:
|
|
1158
|
+
"""Construct a variable-length tuple type"""
|
|
1159
|
+
return Instance(self.fx.std_tuplei, [t])
|
|
1160
|
+
|
|
1161
|
+
def callable(self, *a: Type) -> CallableType:
|
|
1162
|
+
"""callable(a1, ..., an, r) constructs a callable with argument types
|
|
1163
|
+
a1, ... an and return type r.
|
|
1164
|
+
"""
|
|
1165
|
+
n = len(a) - 1
|
|
1166
|
+
return CallableType(list(a[:-1]), [ARG_POS] * n, [None] * n, a[-1], self.fx.function)
|
|
1167
|
+
|
|
1168
|
+
def type_callable(self, *a: Type) -> CallableType:
|
|
1169
|
+
"""type_callable(a1, ..., an, r) constructs a callable with
|
|
1170
|
+
argument types a1, ... an and return type r, and which
|
|
1171
|
+
represents a type.
|
|
1172
|
+
"""
|
|
1173
|
+
n = len(a) - 1
|
|
1174
|
+
return CallableType(list(a[:-1]), [ARG_POS] * n, [None] * n, a[-1], self.fx.type_type)
|
|
1175
|
+
|
|
1176
|
+
|
|
1177
|
+
class MeetSuite(Suite):
|
|
1178
|
+
def setUp(self) -> None:
|
|
1179
|
+
self.fx = TypeFixture()
|
|
1180
|
+
|
|
1181
|
+
def test_trivial_cases(self) -> None:
|
|
1182
|
+
for simple in self.fx.a, self.fx.o, self.fx.b:
|
|
1183
|
+
self.assert_meet(simple, simple, simple)
|
|
1184
|
+
|
|
1185
|
+
def test_class_subtyping(self) -> None:
|
|
1186
|
+
self.assert_meet(self.fx.a, self.fx.o, self.fx.a)
|
|
1187
|
+
self.assert_meet(self.fx.a, self.fx.b, self.fx.b)
|
|
1188
|
+
self.assert_meet(self.fx.b, self.fx.o, self.fx.b)
|
|
1189
|
+
self.assert_meet(self.fx.a, self.fx.d, UninhabitedType())
|
|
1190
|
+
self.assert_meet(self.fx.b, self.fx.c, UninhabitedType())
|
|
1191
|
+
|
|
1192
|
+
def test_tuples(self) -> None:
|
|
1193
|
+
self.assert_meet(self.tuple(), self.tuple(), self.tuple())
|
|
1194
|
+
self.assert_meet(self.tuple(self.fx.a), self.tuple(self.fx.a), self.tuple(self.fx.a))
|
|
1195
|
+
self.assert_meet(
|
|
1196
|
+
self.tuple(self.fx.b, self.fx.c),
|
|
1197
|
+
self.tuple(self.fx.a, self.fx.d),
|
|
1198
|
+
self.tuple(self.fx.b, UninhabitedType()),
|
|
1199
|
+
)
|
|
1200
|
+
|
|
1201
|
+
self.assert_meet(
|
|
1202
|
+
self.tuple(self.fx.a, self.fx.a), self.fx.std_tuple, self.tuple(self.fx.a, self.fx.a)
|
|
1203
|
+
)
|
|
1204
|
+
self.assert_meet(
|
|
1205
|
+
self.tuple(self.fx.a), self.tuple(self.fx.a, self.fx.a), UninhabitedType()
|
|
1206
|
+
)
|
|
1207
|
+
|
|
1208
|
+
def test_function_types(self) -> None:
|
|
1209
|
+
self.assert_meet(
|
|
1210
|
+
self.callable(self.fx.a, self.fx.b),
|
|
1211
|
+
self.callable(self.fx.a, self.fx.b),
|
|
1212
|
+
self.callable(self.fx.a, self.fx.b),
|
|
1213
|
+
)
|
|
1214
|
+
|
|
1215
|
+
self.assert_meet(
|
|
1216
|
+
self.callable(self.fx.a, self.fx.b),
|
|
1217
|
+
self.callable(self.fx.b, self.fx.b),
|
|
1218
|
+
self.callable(self.fx.a, self.fx.b),
|
|
1219
|
+
)
|
|
1220
|
+
self.assert_meet(
|
|
1221
|
+
self.callable(self.fx.a, self.fx.b),
|
|
1222
|
+
self.callable(self.fx.a, self.fx.a),
|
|
1223
|
+
self.callable(self.fx.a, self.fx.b),
|
|
1224
|
+
)
|
|
1225
|
+
|
|
1226
|
+
def test_type_vars(self) -> None:
|
|
1227
|
+
self.assert_meet(self.fx.t, self.fx.t, self.fx.t)
|
|
1228
|
+
self.assert_meet(self.fx.s, self.fx.s, self.fx.s)
|
|
1229
|
+
self.assert_meet(self.fx.t, self.fx.s, UninhabitedType())
|
|
1230
|
+
|
|
1231
|
+
def test_none(self) -> None:
|
|
1232
|
+
self.assert_meet(NoneType(), NoneType(), NoneType())
|
|
1233
|
+
|
|
1234
|
+
self.assert_meet(NoneType(), self.fx.anyt, NoneType())
|
|
1235
|
+
|
|
1236
|
+
# Any type t joined with None results in None, unless t is Any.
|
|
1237
|
+
with state.strict_optional_set(False):
|
|
1238
|
+
for t in [
|
|
1239
|
+
self.fx.a,
|
|
1240
|
+
self.fx.o,
|
|
1241
|
+
UnboundType("x"),
|
|
1242
|
+
self.fx.t,
|
|
1243
|
+
self.tuple(),
|
|
1244
|
+
self.callable(self.fx.a, self.fx.b),
|
|
1245
|
+
]:
|
|
1246
|
+
self.assert_meet(t, NoneType(), NoneType())
|
|
1247
|
+
|
|
1248
|
+
with state.strict_optional_set(True):
|
|
1249
|
+
self.assert_meet(self.fx.o, NoneType(), NoneType())
|
|
1250
|
+
for t in [
|
|
1251
|
+
self.fx.a,
|
|
1252
|
+
UnboundType("x"),
|
|
1253
|
+
self.fx.t,
|
|
1254
|
+
self.tuple(),
|
|
1255
|
+
self.callable(self.fx.a, self.fx.b),
|
|
1256
|
+
]:
|
|
1257
|
+
self.assert_meet(t, NoneType(), UninhabitedType())
|
|
1258
|
+
|
|
1259
|
+
def test_unbound_type(self) -> None:
|
|
1260
|
+
self.assert_meet(UnboundType("x"), UnboundType("x"), self.fx.anyt)
|
|
1261
|
+
self.assert_meet(UnboundType("x"), UnboundType("y"), self.fx.anyt)
|
|
1262
|
+
|
|
1263
|
+
self.assert_meet(UnboundType("x"), self.fx.anyt, UnboundType("x"))
|
|
1264
|
+
|
|
1265
|
+
# The meet of any type t with an unbound type results in dynamic.
|
|
1266
|
+
# Unbound type means that there is an error somewhere in the program,
|
|
1267
|
+
# so this does not affect type safety.
|
|
1268
|
+
for t in [
|
|
1269
|
+
self.fx.a,
|
|
1270
|
+
self.fx.o,
|
|
1271
|
+
self.fx.t,
|
|
1272
|
+
self.tuple(),
|
|
1273
|
+
self.callable(self.fx.a, self.fx.b),
|
|
1274
|
+
]:
|
|
1275
|
+
self.assert_meet(t, UnboundType("X"), self.fx.anyt)
|
|
1276
|
+
|
|
1277
|
+
def test_dynamic_type(self) -> None:
|
|
1278
|
+
# Meet against dynamic type always results in dynamic.
|
|
1279
|
+
for t in [
|
|
1280
|
+
self.fx.anyt,
|
|
1281
|
+
self.fx.a,
|
|
1282
|
+
self.fx.o,
|
|
1283
|
+
NoneType(),
|
|
1284
|
+
UnboundType("x"),
|
|
1285
|
+
self.fx.t,
|
|
1286
|
+
self.tuple(),
|
|
1287
|
+
self.callable(self.fx.a, self.fx.b),
|
|
1288
|
+
]:
|
|
1289
|
+
self.assert_meet(t, self.fx.anyt, t)
|
|
1290
|
+
|
|
1291
|
+
def test_simple_generics(self) -> None:
|
|
1292
|
+
self.assert_meet(self.fx.ga, self.fx.ga, self.fx.ga)
|
|
1293
|
+
self.assert_meet(self.fx.ga, self.fx.o, self.fx.ga)
|
|
1294
|
+
self.assert_meet(self.fx.ga, self.fx.gb, self.fx.gb)
|
|
1295
|
+
self.assert_meet(self.fx.ga, self.fx.gd, UninhabitedType())
|
|
1296
|
+
self.assert_meet(self.fx.ga, self.fx.g2a, UninhabitedType())
|
|
1297
|
+
|
|
1298
|
+
self.assert_meet(self.fx.ga, self.fx.nonet, UninhabitedType())
|
|
1299
|
+
self.assert_meet(self.fx.ga, self.fx.anyt, self.fx.ga)
|
|
1300
|
+
|
|
1301
|
+
for t in [self.fx.a, self.fx.t, self.tuple(), self.callable(self.fx.a, self.fx.b)]:
|
|
1302
|
+
self.assert_meet(t, self.fx.ga, UninhabitedType())
|
|
1303
|
+
|
|
1304
|
+
def test_generics_with_multiple_args(self) -> None:
|
|
1305
|
+
self.assert_meet(self.fx.hab, self.fx.hab, self.fx.hab)
|
|
1306
|
+
self.assert_meet(self.fx.hab, self.fx.haa, self.fx.hab)
|
|
1307
|
+
self.assert_meet(self.fx.hab, self.fx.had, UninhabitedType())
|
|
1308
|
+
self.assert_meet(self.fx.hab, self.fx.hbb, self.fx.hbb)
|
|
1309
|
+
|
|
1310
|
+
def test_generics_with_inheritance(self) -> None:
|
|
1311
|
+
self.assert_meet(self.fx.gsab, self.fx.gb, self.fx.gsab)
|
|
1312
|
+
self.assert_meet(self.fx.gsba, self.fx.gb, UninhabitedType())
|
|
1313
|
+
|
|
1314
|
+
def test_generics_with_inheritance_and_shared_supertype(self) -> None:
|
|
1315
|
+
self.assert_meet(self.fx.gsba, self.fx.gs2a, UninhabitedType())
|
|
1316
|
+
self.assert_meet(self.fx.gsab, self.fx.gs2a, UninhabitedType())
|
|
1317
|
+
|
|
1318
|
+
def test_generic_types_and_dynamic(self) -> None:
|
|
1319
|
+
self.assert_meet(self.fx.gdyn, self.fx.ga, self.fx.ga)
|
|
1320
|
+
|
|
1321
|
+
def test_callables_with_dynamic(self) -> None:
|
|
1322
|
+
self.assert_meet(
|
|
1323
|
+
self.callable(self.fx.a, self.fx.a, self.fx.anyt, self.fx.a),
|
|
1324
|
+
self.callable(self.fx.a, self.fx.anyt, self.fx.a, self.fx.anyt),
|
|
1325
|
+
self.callable(self.fx.a, self.fx.anyt, self.fx.anyt, self.fx.anyt),
|
|
1326
|
+
)
|
|
1327
|
+
|
|
1328
|
+
def test_meet_interface_types(self) -> None:
|
|
1329
|
+
self.assert_meet(self.fx.f, self.fx.f, self.fx.f)
|
|
1330
|
+
self.assert_meet(self.fx.f, self.fx.f2, UninhabitedType())
|
|
1331
|
+
self.assert_meet(self.fx.f, self.fx.f3, self.fx.f3)
|
|
1332
|
+
|
|
1333
|
+
def test_meet_interface_and_class_types(self) -> None:
|
|
1334
|
+
self.assert_meet(self.fx.o, self.fx.f, self.fx.f)
|
|
1335
|
+
self.assert_meet(self.fx.a, self.fx.f, UninhabitedType())
|
|
1336
|
+
|
|
1337
|
+
self.assert_meet(self.fx.e, self.fx.f, self.fx.e)
|
|
1338
|
+
|
|
1339
|
+
def test_meet_class_types_with_shared_interfaces(self) -> None:
|
|
1340
|
+
# These have nothing special with respect to meets, unlike joins. These
|
|
1341
|
+
# are for completeness only.
|
|
1342
|
+
self.assert_meet(self.fx.e, self.fx.e2, UninhabitedType())
|
|
1343
|
+
self.assert_meet(self.fx.e2, self.fx.e3, UninhabitedType())
|
|
1344
|
+
|
|
1345
|
+
def test_meet_with_generic_interfaces(self) -> None:
|
|
1346
|
+
fx = InterfaceTypeFixture()
|
|
1347
|
+
self.assert_meet(fx.gfa, fx.m1, fx.m1)
|
|
1348
|
+
self.assert_meet(fx.gfa, fx.gfa, fx.gfa)
|
|
1349
|
+
self.assert_meet(fx.gfb, fx.m1, UninhabitedType())
|
|
1350
|
+
|
|
1351
|
+
def test_type_type(self) -> None:
|
|
1352
|
+
self.assert_meet(self.fx.type_a, self.fx.type_b, self.fx.type_b)
|
|
1353
|
+
self.assert_meet(self.fx.type_b, self.fx.type_any, self.fx.type_b)
|
|
1354
|
+
self.assert_meet(self.fx.type_b, self.fx.type_type, self.fx.type_b)
|
|
1355
|
+
self.assert_meet(self.fx.type_b, self.fx.type_c, self.fx.type_never)
|
|
1356
|
+
self.assert_meet(self.fx.type_c, self.fx.type_d, self.fx.type_never)
|
|
1357
|
+
self.assert_meet(self.fx.type_type, self.fx.type_any, self.fx.type_any)
|
|
1358
|
+
self.assert_meet(self.fx.type_b, self.fx.anyt, self.fx.type_b)
|
|
1359
|
+
|
|
1360
|
+
def test_literal_type(self) -> None:
|
|
1361
|
+
a = self.fx.a
|
|
1362
|
+
lit1 = self.fx.lit1
|
|
1363
|
+
lit2 = self.fx.lit2
|
|
1364
|
+
lit3 = self.fx.lit3
|
|
1365
|
+
|
|
1366
|
+
self.assert_meet(lit1, lit1, lit1)
|
|
1367
|
+
self.assert_meet(lit1, a, lit1)
|
|
1368
|
+
self.assert_meet_uninhabited(lit1, lit3)
|
|
1369
|
+
self.assert_meet_uninhabited(lit1, lit2)
|
|
1370
|
+
self.assert_meet(UnionType([lit1, lit2]), lit1, lit1)
|
|
1371
|
+
self.assert_meet(UnionType([lit1, lit2]), UnionType([lit2, lit3]), lit2)
|
|
1372
|
+
self.assert_meet(UnionType([lit1, lit2]), UnionType([lit1, lit2]), UnionType([lit1, lit2]))
|
|
1373
|
+
self.assert_meet(lit1, self.fx.anyt, lit1)
|
|
1374
|
+
self.assert_meet(lit1, self.fx.o, lit1)
|
|
1375
|
+
|
|
1376
|
+
assert is_same_type(lit1, narrow_declared_type(lit1, a))
|
|
1377
|
+
assert is_same_type(lit2, narrow_declared_type(lit2, a))
|
|
1378
|
+
|
|
1379
|
+
# FIX generic interfaces + ranges
|
|
1380
|
+
|
|
1381
|
+
def assert_meet_uninhabited(self, s: Type, t: Type) -> None:
|
|
1382
|
+
with state.strict_optional_set(False):
|
|
1383
|
+
self.assert_meet(s, t, self.fx.nonet)
|
|
1384
|
+
with state.strict_optional_set(True):
|
|
1385
|
+
self.assert_meet(s, t, self.fx.uninhabited)
|
|
1386
|
+
|
|
1387
|
+
def test_variadic_tuple_meets(self) -> None:
|
|
1388
|
+
# These tests really test just the "arity", to be sure it is handled correctly.
|
|
1389
|
+
self.assert_meet(
|
|
1390
|
+
self.tuple(self.fx.a, self.fx.a),
|
|
1391
|
+
self.tuple(UnpackType(Instance(self.fx.std_tuplei, [self.fx.a]))),
|
|
1392
|
+
self.tuple(self.fx.a, self.fx.a),
|
|
1393
|
+
)
|
|
1394
|
+
self.assert_meet(
|
|
1395
|
+
self.tuple(self.fx.a, self.fx.a),
|
|
1396
|
+
self.tuple(UnpackType(Instance(self.fx.std_tuplei, [self.fx.a])), self.fx.a),
|
|
1397
|
+
self.tuple(self.fx.a, self.fx.a),
|
|
1398
|
+
)
|
|
1399
|
+
self.assert_meet(
|
|
1400
|
+
self.tuple(self.fx.a, self.fx.a),
|
|
1401
|
+
self.tuple(self.fx.a, UnpackType(Instance(self.fx.std_tuplei, [self.fx.a]))),
|
|
1402
|
+
self.tuple(self.fx.a, self.fx.a),
|
|
1403
|
+
)
|
|
1404
|
+
self.assert_meet(
|
|
1405
|
+
self.tuple(UnpackType(Instance(self.fx.std_tuplei, [self.fx.a]))),
|
|
1406
|
+
self.tuple(UnpackType(Instance(self.fx.std_tuplei, [self.fx.a]))),
|
|
1407
|
+
self.tuple(UnpackType(Instance(self.fx.std_tuplei, [self.fx.a]))),
|
|
1408
|
+
)
|
|
1409
|
+
self.assert_meet(
|
|
1410
|
+
self.tuple(UnpackType(Instance(self.fx.std_tuplei, [self.fx.a])), self.fx.a),
|
|
1411
|
+
self.tuple(self.fx.b, UnpackType(Instance(self.fx.std_tuplei, [self.fx.b]))),
|
|
1412
|
+
self.tuple(self.fx.b, UnpackType(Instance(self.fx.std_tuplei, [self.fx.b]))),
|
|
1413
|
+
)
|
|
1414
|
+
|
|
1415
|
+
def assert_meet(self, s: Type, t: Type, meet: Type) -> None:
|
|
1416
|
+
self.assert_simple_meet(s, t, meet)
|
|
1417
|
+
self.assert_simple_meet(t, s, meet)
|
|
1418
|
+
|
|
1419
|
+
def assert_simple_meet(self, s: Type, t: Type, meet: Type) -> None:
|
|
1420
|
+
result = meet_types(s, t)
|
|
1421
|
+
actual = str(result)
|
|
1422
|
+
expected = str(meet)
|
|
1423
|
+
assert_equal(actual, expected, f"meet({s}, {t}) == {{}} ({{}} expected)")
|
|
1424
|
+
assert is_subtype(result, s), f"{result} not subtype of {s}"
|
|
1425
|
+
assert is_subtype(result, t), f"{result} not subtype of {t}"
|
|
1426
|
+
|
|
1427
|
+
def tuple(self, *a: Type) -> TupleType:
|
|
1428
|
+
return TupleType(list(a), self.fx.std_tuple)
|
|
1429
|
+
|
|
1430
|
+
def callable(self, *a: Type) -> CallableType:
|
|
1431
|
+
"""callable(a1, ..., an, r) constructs a callable with argument types
|
|
1432
|
+
a1, ... an and return type r.
|
|
1433
|
+
"""
|
|
1434
|
+
n = len(a) - 1
|
|
1435
|
+
return CallableType(list(a[:-1]), [ARG_POS] * n, [None] * n, a[-1], self.fx.function)
|
|
1436
|
+
|
|
1437
|
+
|
|
1438
|
+
class SameTypeSuite(Suite):
|
|
1439
|
+
def setUp(self) -> None:
|
|
1440
|
+
self.fx = TypeFixture()
|
|
1441
|
+
|
|
1442
|
+
def test_literal_type(self) -> None:
|
|
1443
|
+
a = self.fx.a
|
|
1444
|
+
b = self.fx.b # Reminder: b is a subclass of a
|
|
1445
|
+
|
|
1446
|
+
lit1 = self.fx.lit1
|
|
1447
|
+
lit2 = self.fx.lit2
|
|
1448
|
+
lit3 = self.fx.lit3
|
|
1449
|
+
|
|
1450
|
+
self.assert_same(lit1, lit1)
|
|
1451
|
+
self.assert_same(UnionType([lit1, lit2]), UnionType([lit1, lit2]))
|
|
1452
|
+
self.assert_same(UnionType([lit1, lit2]), UnionType([lit2, lit1]))
|
|
1453
|
+
self.assert_same(UnionType([a, b]), UnionType([b, a]))
|
|
1454
|
+
self.assert_not_same(lit1, b)
|
|
1455
|
+
self.assert_not_same(lit1, lit2)
|
|
1456
|
+
self.assert_not_same(lit1, lit3)
|
|
1457
|
+
|
|
1458
|
+
self.assert_not_same(lit1, self.fx.anyt)
|
|
1459
|
+
self.assert_not_same(lit1, self.fx.nonet)
|
|
1460
|
+
|
|
1461
|
+
def assert_same(self, s: Type, t: Type, strict: bool = True) -> None:
|
|
1462
|
+
self.assert_simple_is_same(s, t, expected=True, strict=strict)
|
|
1463
|
+
self.assert_simple_is_same(t, s, expected=True, strict=strict)
|
|
1464
|
+
|
|
1465
|
+
def assert_not_same(self, s: Type, t: Type, strict: bool = True) -> None:
|
|
1466
|
+
self.assert_simple_is_same(s, t, False, strict=strict)
|
|
1467
|
+
self.assert_simple_is_same(t, s, False, strict=strict)
|
|
1468
|
+
|
|
1469
|
+
def assert_simple_is_same(self, s: Type, t: Type, expected: bool, strict: bool) -> None:
|
|
1470
|
+
actual = is_same_type(s, t)
|
|
1471
|
+
assert_equal(actual, expected, f"is_same_type({s}, {t}) is {{}} ({{}} expected)")
|
|
1472
|
+
|
|
1473
|
+
if strict:
|
|
1474
|
+
actual2 = s == t
|
|
1475
|
+
assert_equal(actual2, expected, f"({s} == {t}) is {{}} ({{}} expected)")
|
|
1476
|
+
assert_equal(
|
|
1477
|
+
hash(s) == hash(t), expected, f"(hash({s}) == hash({t}) is {{}} ({{}} expected)"
|
|
1478
|
+
)
|
|
1479
|
+
|
|
1480
|
+
|
|
1481
|
+
class RemoveLastKnownValueSuite(Suite):
|
|
1482
|
+
def setUp(self) -> None:
|
|
1483
|
+
self.fx = TypeFixture()
|
|
1484
|
+
|
|
1485
|
+
def test_optional(self) -> None:
|
|
1486
|
+
t = UnionType.make_union([self.fx.a, self.fx.nonet])
|
|
1487
|
+
self.assert_union_result(t, [self.fx.a, self.fx.nonet])
|
|
1488
|
+
|
|
1489
|
+
def test_two_instances(self) -> None:
|
|
1490
|
+
t = UnionType.make_union([self.fx.a, self.fx.b])
|
|
1491
|
+
self.assert_union_result(t, [self.fx.a, self.fx.b])
|
|
1492
|
+
|
|
1493
|
+
def test_multiple_same_instances(self) -> None:
|
|
1494
|
+
t = UnionType.make_union([self.fx.a, self.fx.a])
|
|
1495
|
+
assert remove_instance_last_known_values(t) == self.fx.a
|
|
1496
|
+
t = UnionType.make_union([self.fx.a, self.fx.a, self.fx.b])
|
|
1497
|
+
self.assert_union_result(t, [self.fx.a, self.fx.b])
|
|
1498
|
+
t = UnionType.make_union([self.fx.a, self.fx.nonet, self.fx.a, self.fx.b])
|
|
1499
|
+
self.assert_union_result(t, [self.fx.a, self.fx.nonet, self.fx.b])
|
|
1500
|
+
|
|
1501
|
+
def test_single_last_known_value(self) -> None:
|
|
1502
|
+
t = UnionType.make_union([self.fx.lit1_inst, self.fx.nonet])
|
|
1503
|
+
self.assert_union_result(t, [self.fx.a, self.fx.nonet])
|
|
1504
|
+
|
|
1505
|
+
def test_last_known_values_with_merge(self) -> None:
|
|
1506
|
+
t = UnionType.make_union([self.fx.lit1_inst, self.fx.lit2_inst, self.fx.lit4_inst])
|
|
1507
|
+
assert remove_instance_last_known_values(t) == self.fx.a
|
|
1508
|
+
t = UnionType.make_union(
|
|
1509
|
+
[self.fx.lit1_inst, self.fx.b, self.fx.lit2_inst, self.fx.lit4_inst]
|
|
1510
|
+
)
|
|
1511
|
+
self.assert_union_result(t, [self.fx.a, self.fx.b])
|
|
1512
|
+
|
|
1513
|
+
def test_generics(self) -> None:
|
|
1514
|
+
t = UnionType.make_union([self.fx.ga, self.fx.gb])
|
|
1515
|
+
self.assert_union_result(t, [self.fx.ga, self.fx.gb])
|
|
1516
|
+
|
|
1517
|
+
def assert_union_result(self, t: ProperType, expected: list[Type]) -> None:
|
|
1518
|
+
t2 = remove_instance_last_known_values(t)
|
|
1519
|
+
assert type(t2) is UnionType
|
|
1520
|
+
assert t2.items == expected
|
|
1521
|
+
|
|
1522
|
+
|
|
1523
|
+
class ShallowOverloadMatchingSuite(Suite):
|
|
1524
|
+
def setUp(self) -> None:
|
|
1525
|
+
self.fx = TypeFixture()
|
|
1526
|
+
|
|
1527
|
+
def test_simple(self) -> None:
|
|
1528
|
+
fx = self.fx
|
|
1529
|
+
ov = self.make_overload([[("x", fx.anyt, ARG_NAMED)], [("y", fx.anyt, ARG_NAMED)]])
|
|
1530
|
+
# Match first only
|
|
1531
|
+
self.assert_find_shallow_matching_overload_item(ov, make_call(("foo", "x")), 0)
|
|
1532
|
+
# Match second only
|
|
1533
|
+
self.assert_find_shallow_matching_overload_item(ov, make_call(("foo", "y")), 1)
|
|
1534
|
+
# No match -- invalid keyword arg name
|
|
1535
|
+
self.assert_find_shallow_matching_overload_item(ov, make_call(("foo", "z")), 1)
|
|
1536
|
+
# No match -- missing arg
|
|
1537
|
+
self.assert_find_shallow_matching_overload_item(ov, make_call(), 1)
|
|
1538
|
+
# No match -- extra arg
|
|
1539
|
+
self.assert_find_shallow_matching_overload_item(
|
|
1540
|
+
ov, make_call(("foo", "x"), ("foo", "z")), 1
|
|
1541
|
+
)
|
|
1542
|
+
|
|
1543
|
+
def test_match_using_types(self) -> None:
|
|
1544
|
+
fx = self.fx
|
|
1545
|
+
ov = self.make_overload(
|
|
1546
|
+
[
|
|
1547
|
+
[("x", fx.nonet, ARG_POS)],
|
|
1548
|
+
[("x", fx.lit_false, ARG_POS)],
|
|
1549
|
+
[("x", fx.lit_true, ARG_POS)],
|
|
1550
|
+
[("x", fx.anyt, ARG_POS)],
|
|
1551
|
+
]
|
|
1552
|
+
)
|
|
1553
|
+
self.assert_find_shallow_matching_overload_item(ov, make_call(("None", None)), 0)
|
|
1554
|
+
self.assert_find_shallow_matching_overload_item(ov, make_call(("builtins.False", None)), 1)
|
|
1555
|
+
self.assert_find_shallow_matching_overload_item(ov, make_call(("builtins.True", None)), 2)
|
|
1556
|
+
self.assert_find_shallow_matching_overload_item(ov, make_call(("foo", None)), 3)
|
|
1557
|
+
|
|
1558
|
+
def test_none_special_cases(self) -> None:
|
|
1559
|
+
fx = self.fx
|
|
1560
|
+
ov = self.make_overload(
|
|
1561
|
+
[[("x", fx.callable(fx.nonet), ARG_POS)], [("x", fx.nonet, ARG_POS)]]
|
|
1562
|
+
)
|
|
1563
|
+
self.assert_find_shallow_matching_overload_item(ov, make_call(("None", None)), 1)
|
|
1564
|
+
self.assert_find_shallow_matching_overload_item(ov, make_call(("func", None)), 0)
|
|
1565
|
+
ov = self.make_overload([[("x", fx.str_type, ARG_POS)], [("x", fx.nonet, ARG_POS)]])
|
|
1566
|
+
self.assert_find_shallow_matching_overload_item(ov, make_call(("None", None)), 1)
|
|
1567
|
+
self.assert_find_shallow_matching_overload_item(ov, make_call(("func", None)), 0)
|
|
1568
|
+
ov = self.make_overload(
|
|
1569
|
+
[[("x", UnionType([fx.str_type, fx.a]), ARG_POS)], [("x", fx.nonet, ARG_POS)]]
|
|
1570
|
+
)
|
|
1571
|
+
self.assert_find_shallow_matching_overload_item(ov, make_call(("None", None)), 1)
|
|
1572
|
+
self.assert_find_shallow_matching_overload_item(ov, make_call(("func", None)), 0)
|
|
1573
|
+
ov = self.make_overload([[("x", fx.o, ARG_POS)], [("x", fx.nonet, ARG_POS)]])
|
|
1574
|
+
self.assert_find_shallow_matching_overload_item(ov, make_call(("None", None)), 0)
|
|
1575
|
+
self.assert_find_shallow_matching_overload_item(ov, make_call(("func", None)), 0)
|
|
1576
|
+
ov = self.make_overload(
|
|
1577
|
+
[[("x", UnionType([fx.str_type, fx.nonet]), ARG_POS)], [("x", fx.nonet, ARG_POS)]]
|
|
1578
|
+
)
|
|
1579
|
+
self.assert_find_shallow_matching_overload_item(ov, make_call(("None", None)), 0)
|
|
1580
|
+
self.assert_find_shallow_matching_overload_item(ov, make_call(("func", None)), 0)
|
|
1581
|
+
ov = self.make_overload([[("x", fx.anyt, ARG_POS)], [("x", fx.nonet, ARG_POS)]])
|
|
1582
|
+
self.assert_find_shallow_matching_overload_item(ov, make_call(("None", None)), 0)
|
|
1583
|
+
self.assert_find_shallow_matching_overload_item(ov, make_call(("func", None)), 0)
|
|
1584
|
+
|
|
1585
|
+
def test_optional_arg(self) -> None:
|
|
1586
|
+
fx = self.fx
|
|
1587
|
+
ov = self.make_overload(
|
|
1588
|
+
[[("x", fx.anyt, ARG_NAMED)], [("y", fx.anyt, ARG_OPT)], [("z", fx.anyt, ARG_NAMED)]]
|
|
1589
|
+
)
|
|
1590
|
+
self.assert_find_shallow_matching_overload_item(ov, make_call(), 1)
|
|
1591
|
+
self.assert_find_shallow_matching_overload_item(ov, make_call(("foo", "x")), 0)
|
|
1592
|
+
self.assert_find_shallow_matching_overload_item(ov, make_call(("foo", "y")), 1)
|
|
1593
|
+
self.assert_find_shallow_matching_overload_item(ov, make_call(("foo", "z")), 2)
|
|
1594
|
+
|
|
1595
|
+
def test_two_args(self) -> None:
|
|
1596
|
+
fx = self.fx
|
|
1597
|
+
ov = self.make_overload(
|
|
1598
|
+
[
|
|
1599
|
+
[("x", fx.nonet, ARG_OPT), ("y", fx.anyt, ARG_OPT)],
|
|
1600
|
+
[("x", fx.anyt, ARG_OPT), ("y", fx.anyt, ARG_OPT)],
|
|
1601
|
+
]
|
|
1602
|
+
)
|
|
1603
|
+
self.assert_find_shallow_matching_overload_item(ov, make_call(), 0)
|
|
1604
|
+
self.assert_find_shallow_matching_overload_item(ov, make_call(("None", "x")), 0)
|
|
1605
|
+
self.assert_find_shallow_matching_overload_item(ov, make_call(("foo", "x")), 1)
|
|
1606
|
+
self.assert_find_shallow_matching_overload_item(
|
|
1607
|
+
ov, make_call(("foo", "y"), ("None", "x")), 0
|
|
1608
|
+
)
|
|
1609
|
+
self.assert_find_shallow_matching_overload_item(
|
|
1610
|
+
ov, make_call(("foo", "y"), ("bar", "x")), 1
|
|
1611
|
+
)
|
|
1612
|
+
|
|
1613
|
+
def assert_find_shallow_matching_overload_item(
|
|
1614
|
+
self, ov: Overloaded, call: CallExpr, expected_index: int
|
|
1615
|
+
) -> None:
|
|
1616
|
+
c = find_shallow_matching_overload_item(ov, call)
|
|
1617
|
+
assert c in ov.items
|
|
1618
|
+
assert ov.items.index(c) == expected_index
|
|
1619
|
+
|
|
1620
|
+
def make_overload(self, items: list[list[tuple[str, Type, ArgKind]]]) -> Overloaded:
|
|
1621
|
+
result = []
|
|
1622
|
+
for item in items:
|
|
1623
|
+
arg_types = []
|
|
1624
|
+
arg_names = []
|
|
1625
|
+
arg_kinds = []
|
|
1626
|
+
for name, typ, kind in item:
|
|
1627
|
+
arg_names.append(name)
|
|
1628
|
+
arg_types.append(typ)
|
|
1629
|
+
arg_kinds.append(kind)
|
|
1630
|
+
result.append(
|
|
1631
|
+
CallableType(
|
|
1632
|
+
arg_types, arg_kinds, arg_names, ret_type=NoneType(), fallback=self.fx.o
|
|
1633
|
+
)
|
|
1634
|
+
)
|
|
1635
|
+
return Overloaded(result)
|
|
1636
|
+
|
|
1637
|
+
|
|
1638
|
+
def make_call(*items: tuple[str, str | None]) -> CallExpr:
|
|
1639
|
+
args: list[Expression] = []
|
|
1640
|
+
arg_names = []
|
|
1641
|
+
arg_kinds = []
|
|
1642
|
+
for arg, name in items:
|
|
1643
|
+
shortname = arg.split(".")[-1]
|
|
1644
|
+
n = NameExpr(shortname)
|
|
1645
|
+
n.fullname = arg
|
|
1646
|
+
args.append(n)
|
|
1647
|
+
arg_names.append(name)
|
|
1648
|
+
if name:
|
|
1649
|
+
arg_kinds.append(ARG_NAMED)
|
|
1650
|
+
else:
|
|
1651
|
+
arg_kinds.append(ARG_POS)
|
|
1652
|
+
return CallExpr(NameExpr("f"), args, arg_kinds, arg_names)
|
|
1653
|
+
|
|
1654
|
+
|
|
1655
|
+
class TestExpandTypeLimitGetProperType(TestCase):
|
|
1656
|
+
# WARNING: do not increase this number unless absolutely necessary,
|
|
1657
|
+
# and you understand what you are doing.
|
|
1658
|
+
ALLOWED_GET_PROPER_TYPES = 7
|
|
1659
|
+
|
|
1660
|
+
@skipUnless(mypy.expandtype.__file__.endswith(".py"), "Skip for compiled mypy")
|
|
1661
|
+
def test_count_get_proper_type(self) -> None:
|
|
1662
|
+
with open(mypy.expandtype.__file__) as f:
|
|
1663
|
+
code = f.read()
|
|
1664
|
+
get_proper_type_count = len(re.findall(r"get_proper_type\(", code))
|
|
1665
|
+
get_proper_type_count -= len(re.findall(r"get_proper_type\(\)", code))
|
|
1666
|
+
assert get_proper_type_count == self.ALLOWED_GET_PROPER_TYPES
|