Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved consistency of unreachable code. Previously, unreachable cod… #8187

Closed
wants to merge 1 commit into from

Conversation

erictraut
Copy link
Collaborator

…e was not supported for if or else suites when the condition type was narrowed to Never. This addresses microsoft/pylance-release#6028.

…e was not supported for `if` or `else` suites when the condition type was narrowed to `Never`. This addresses microsoft/pylance-release#6028.
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

pandera (https://github.com/pandera-dev/pandera)
-   /tmp/mypy_primer/projects/pandera/tests/core/test_schema_components.py:475:52 - error: Cannot access attribute "tolist" for class "Iterable[Unknown]"
-     Attribute "tolist" is unknown (reportAttributeAccessIssue)
- 2032 errors, 25 warnings, 0 informations 
+ 2031 errors, 25 warnings, 0 informations 

dd-trace-py (https://github.com/DataDog/dd-trace-py)
+ /tmp/mypy_primer/projects/dd-trace-py/ddtrace/appsec/_remoteconfiguration.py
+   /tmp/mypy_primer/projects/dd-trace-py/ddtrace/appsec/_remoteconfiguration.py:206:41 - error: "rc_asm_enabled" is possibly unbound (reportPossiblyUnboundVariable)
+   /tmp/mypy_primer/projects/dd-trace-py/ddtrace/appsec/_remoteconfiguration.py:207:12 - error: "rc_asm_enabled" is possibly unbound (reportPossiblyUnboundVariable)
+   /tmp/mypy_primer/projects/dd-trace-py/ddtrace/appsec/_remoteconfiguration.py:212:17 - error: "rc_asm_enabled" is possibly unbound (reportPossiblyUnboundVariable)
+   /tmp/mypy_primer/projects/dd-trace-py/ddtrace/appsec/_remoteconfiguration.py:215:16 - error: "rc_asm_enabled" is possibly unbound (reportPossiblyUnboundVariable)
-   /tmp/mypy_primer/projects/dd-trace-py/ddtrace/appsec/_iast/taint_sinks/_base.py:132:28 - error: Expected no arguments to "Evidence" constructor (reportCallIssue)
+   /tmp/mypy_primer/projects/dd-trace-py/ddtrace/appsec/_iast/taint_sinks/_base.py:134:72 - error: "evidence" is possibly unbound (reportPossiblyUnboundVariable)
-   /tmp/mypy_primer/projects/dd-trace-py/tests/utils.py:1303:17 - error: Expression of type "datetime" is incompatible with declared type "int"
-     "datetime" is incompatible with "int" (reportAssignmentType)
- 11603 errors, 583 warnings, 0 informations 
+ 11606 errors, 583 warnings, 0 informations 

pydantic (https://github.com/samuelcolvin/pydantic)
+   /tmp/mypy_primer/projects/pydantic/pydantic/json_schema.py:2348:25 - error: Cannot access attribute "append" for class "Unbound" (reportAttributeAccessIssue)
- 256 errors, 46 warnings, 0 informations 
+ 257 errors, 46 warnings, 0 informations 

freqtrade (https://github.com/freqtrade/freqtrade)
+   /tmp/mypy_primer/projects/freqtrade/freqtrade/rpc/telegram.py:547:16 - error: "message" is possibly unbound (reportPossiblyUnboundVariable)
- 595 errors, 44 warnings, 0 informations 
+ 596 errors, 44 warnings, 0 informations 

trio (https://github.com/python-trio/trio)
-   /tmp/mypy_primer/projects/trio/src/trio/_core/_tests/test_run.py:2271:12 - error: Type of "coro" is unknown (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/trio/src/trio/_core/_tests/test_run.py:2271:12 - error: Type of "throw" is unknown (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/trio/src/trio/_core/_tests/test_run.py:2272:28 - error: Type of "Error" is unknown (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/trio/src/trio/_core/_tests/test_run.py:2273:10 - error: Type of "raises" is unknown (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/trio/src/trio/_subprocess_platform/waitid.py:108:9 - error: Argument type is partially unknown
-     Argument corresponds to parameter "args" in function "spawn_system_task"
-     Argument type is "*tuple[Unknown, Event]" (reportUnknownArgumentType)
-   /tmp/mypy_primer/projects/trio/src/trio/_tests/test_channel.py:384:10 - error: Type of "raises" is unknown (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/trio/src/trio/_tests/test_channel.py:390:14 - error: Type of "raises" is unknown (reportUnknownMemberType)
- 3760 errors, 52 warnings, 0 informations 
+ 3753 errors, 52 warnings, 0 informations 

@erictraut erictraut closed this Jun 20, 2024
@erictraut erictraut deleted the issue6028-2 branch June 20, 2024 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant