Skip to content

Check #18972 #27

Closed as not planned
Closed as not planned

Description

@sterliakov
No description provided.

Activity

  1. github-actions commented on Apr 26, 2025

    @github-actions

    Results are ready!

    ================================================================================
    #18967: Change of binder behavior whan narrowing to unrelated type
    Labels: bug, topic-type-narrowing
    @@ -1,4 +1,4 @@
     gh_18967_body_0.py:1: error: Function is missing a return type annotation  [no-untyped-def]
     gh_18967_body_0.py:6: error: Call to untyped function "any" in typed context  [no-untyped-call]
    -gh_18967_body_0.py:8: note: Revealed type is "Never"
    +gh_18967_body_0.py:8: note: Revealed type is "builtins.int"
     Found 2 errors in 1 file (checked 1 source file)
    
    ================================================================================
    #18866: Wrong types when pattern matching `int` with `http.HTTPStatus`
    Labels: bug, topic-enum, topic-match-statement, topic-runtime-semantics
    @@ -1,3 +1,3 @@
     gh_18866_body_0.py:10: note: Revealed type is "Literal[http.HTTPStatus.OK]"
    -gh_18866_body_0.py:19: note: Revealed type is "Never"
    +gh_18866_body_0.py:19: note: Revealed type is "Literal[200]"
     Success: no issues found in 1 source file
    
    ================================================================================
    #18524: "Statement is unreachable" when doing `match` on `type` objects
    Labels: bug, topic-match-statement, topic-reachability
    @@ -1,6 +1,6 @@
     gh_18524_c2613070787_0.py:8: note: Revealed type is "type[Any]"
    -gh_18524_c2613070787_0.py:11: note: Revealed type is "Never"
    -gh_18524_c2613070787_0.py:14: note: Revealed type is "Never"
    +gh_18524_c2613070787_0.py:11: note: Revealed type is "Overload(def (object: builtins.object =) -> builtins.str, def (object: _collections_abc.Buffer, encoding: builtins.str =, errors: builtins.str =) -> builtins.str)"
    +gh_18524_c2613070787_0.py:14: note: Revealed type is "Overload(def (Union[typing.Iterable[typing.SupportsIndex], typing.SupportsIndex, typing.SupportsBytes, _collections_abc.Buffer]) -> builtins.bytes, def (builtins.str, encoding: builtins.str, errors: builtins.str =) -> builtins.bytes, def () -> builtins.bytes)"
     gh_18524_c2613070787_0.py:17: note: Revealed type is "type[builtins.bool]"
     gh_18524_c2613070787_0.py:20: error: Statement is unreachable  [unreachable]
     gh_18524_c2613070787_0.py:23: note: Revealed type is "type[builtins.bool]"
    
    ================================================================================
    #16979: MyPy is nondeterministic across runs
    Labels: bug, topic-incremental, priority-0-high
    @@ -1,6 +1,5 @@
     gh_16979_c1975009058_0.py:23: error: Unused "type: ignore" comment  [unused-ignore]
     gh_16979_c1975009058_0.py:30: note: Revealed type is "gh_16979_c1975009058_0.A[builtins.int, builtins.int]"
     gh_16979_c1975009058_0.py:31: note: Revealed type is "gh_16979_c1975009058_0.A[gh_16979_c1975009058_0.Comparable, gh_16979_c1975009058_0.Comparable]"
    -gh_16979_c1975009058_0.py:32: note: Revealed type is "gh_16979_c1975009058_0.A[gh_16979_c1975009058_0._SupportsCompare, gh_16979_c1975009058_0._SupportsCompare]"
    -gh_16979_c1975009058_0.py:33: note: Revealed type is "gh_16979_c1975009058_0.A[gh_16979_c1975009058_0._SupportsCompare, gh_16979_c1975009058_0._SupportsCompare]"
    +gh_16979_c1975009058_0.py:32: note: Revealed type is "Never"
     Found 1 error in 1 file (checked 1 source file)
    
    @@ -1,4 +1,4 @@
     gh_16979_c1982246306_0.py:17: error: Unused "type: ignore" comment  [unused-ignore]
     gh_16979_c1982246306_0.py:20: error: Function is missing a type annotation for one or more arguments  [no-untyped-def]
    -gh_16979_c1982246306_0.py:24: note: Revealed type is "gh_16979_c1982246306_0.A[builtins.object, builtins.object]"
    +gh_16979_c1982246306_0.py:24: note: Revealed type is "gh_16979_c1982246306_0.A[gh_16979_c1982246306_0._SupportsCompare, gh_16979_c1982246306_0._SupportsCompare]"
     Found 2 errors in 1 file (checked 1 source file)
    
    ================================================================================
    #16494: Type-narrowing from parent to child class produces `Never` if inheriting from a concrete version of a generic parent class.
    Labels: bug
    @@ -1,2 +1,2 @@
    -gh_16494_body_0.py:11: note: Revealed type is "Never"
    +gh_16494_body_0.py:11: note: Revealed type is "gh_16494_body_0.Child"
     Success: no issues found in 1 source file
    
    ================================================================================
    #16413:  <nothing> when narrowing types on union of subtypes
    Labels: bug
    @@ -1,5 +1,4 @@
     gh_16413_body_0.py:22: note: Revealed type is "Union[gh_16413_body_0.<subclass of "gh_16413_body_0.Base" and "gh_16413_body_0.FooMixin">, gh_16413_body_0.<subclass of "gh_16413_body_0.Base" and "gh_16413_body_0.BarMixin">]"
    -gh_16413_body_0.py:25: note: Revealed type is "Never"
    -gh_16413_body_0.py:26: error: "Never" has no attribute "foo"  [attr-defined]
    +gh_16413_body_0.py:25: note: Revealed type is "gh_16413_body_0.FooMixin"
     gh_16413_body_0.py:28: note: Revealed type is "gh_16413_body_0.<subclass of "gh_16413_body_0.Base" and "gh_16413_body_0.BarMixin">"
    -Found 1 error in 1 file (checked 1 source file)
    +Success: no issues found in 1 source file
    
    ================================================================================
    #15793: mypy thinks value is `<nothing>` when it isn't
    Labels: bug
    @@ -1,2 +1 @@
    -gh_15793_body_0.py:13: error: "Never" has no attribute "something"  [attr-defined]
    -Found 1 error in 1 file (checked 1 source file)
    +Success: no issues found in 1 source file
    
    @@ -1,2 +1 @@
    -gh_15793_c1678223086_0.py:18: error: "Never" has no attribute "something"  [attr-defined]
    -Found 1 error in 1 file (checked 1 source file)
    +Success: no issues found in 1 source file
    
    ================================================================================
    #15028: (🐞) Incorrect narrowing unions of intersections to `Never`
    Labels: bug
    @@ -1,5 +1,5 @@
     gh_15028_c1575904571_0.py:4: error: Function is missing a return type annotation  [no-untyped-def]
     gh_15028_c1575904571_0.py:5: note: Revealed type is "gh_15028_c1575904571_0.A"
     gh_15028_c1575904571_0.py:7: note: Revealed type is "Union[gh_15028_c1575904571_0.<subclass of "gh_15028_c1575904571_0.A" and "gh_15028_c1575904571_0.B">, gh_15028_c1575904571_0.<subclass of "gh_15028_c1575904571_0.A" and "gh_15028_c1575904571_0.C">]"
    -gh_15028_c1575904571_0.py:9: note: Revealed type is "Never"
    +gh_15028_c1575904571_0.py:9: note: Revealed type is "gh_15028_c1575904571_0.C"
     Found 1 error in 1 file (checked 1 source file)
    
    @@ -1,4 +1,4 @@
     gh_15028_body_0.py:7: note: Revealed type is "gh_15028_body_0.A"
     gh_15028_body_0.py:9: note: Revealed type is "Union[gh_15028_body_0.<subclass of "gh_15028_body_0.A" and "gh_15028_body_0.B">, gh_15028_body_0.<subclass of "gh_15028_body_0.A" and "gh_15028_body_0.C">]"
    -gh_15028_body_0.py:11: note: Revealed type is "Never"
    +gh_15028_body_0.py:11: note: Revealed type is "gh_15028_body_0.C"
     Success: no issues found in 1 source file
    
    ================================================================================
    #14275: about Iterable[T] and str
    Labels: bug, topic-type-narrowing
    @@ -1,3 +1,3 @@
    -gh_14275_body_0.py:7: error: "Never" has no attribute "split"  [attr-defined]
    -gh_14275_body_0.py:10: error: Returning Any from function declared to return "list[T]"  [no-any-return]
    +gh_14275_body_0.py:9: error: Argument 1 to "list" has incompatible type "Iterable[T]"; expected "Iterable[str]"  [arg-type]
    +gh_14275_body_0.py:10: error: Incompatible return value type (got "list[str]", expected "list[T]")  [return-value]
     Found 2 errors in 1 file (checked 1 source file)
    
    ================================================================================
    #13841: Enum instance type ignored in match/case statements
    Labels: feature, topic-enum, topic-match-statement
    @@ -1,6 +1,6 @@
     gh_13841_body_4.py:11: note: Revealed type is "Literal[gh_13841_body_4.FooClass.FOO]?"
    -gh_13841_body_4.py:12: note: Revealed type is "Never"
    -gh_13841_body_4.py:13: error: "Never" has no attribute "FOO"  [attr-defined]
    +gh_13841_body_4.py:12: note: Revealed type is "Literal[0]"
    +gh_13841_body_4.py:13: error: "Literal[0]" has no attribute "FOO"  [attr-defined]
     gh_13841_body_4.py:13: note: Revealed type is "Any"
     gh_13841_body_4.py:14: error: Unsupported operand types for + ("int" and "str")  [operator]
     Found 2 errors in 1 file (checked 1 source file)
    
    ================================================================================
    #12949: isinstance erases type info
    Labels: bug, topic-type-variables, topic-type-narrowing
    @@ -1,5 +1,4 @@
     gh_12949_body_0.py:9: note: Revealed type is "builtins.list[T`-1]"
    -gh_12949_body_0.py:11: note: Revealed type is "Never"
    -gh_12949_body_0.py:12: error: "Never" has no attribute "pop"  [attr-defined]
    +gh_12949_body_0.py:11: note: Revealed type is "gh_12949_body_0.IntList"
     gh_12949_body_0.py:13: note: Revealed type is "builtins.list[T`-1]"
    -Found 1 error in 1 file (checked 1 source file)
    +Success: no issues found in 1 source file
    
    ================================================================================
    #12060: instance check with generic `type` causes narrowing to `<nothing>`
    Labels: bug, topic-type-narrowing
    @@ -1,2 +1 @@
    -gh_12060_body_0.py:7: error: "Never" has no attribute "__str__"  [attr-defined]
    -Found 1 error in 1 file (checked 1 source file)
    +Success: no issues found in 1 source file
    
    ================================================================================
    #4952: isinstance can coerce a known type to become None
    Labels: bug, priority-1-normal, false-positive
    @@ -1,4 +1,4 @@
     gh_4952_body_0.py:11: note: Revealed type is "gh_4952_body_0.A"
    -gh_4952_body_0.py:13: note: Revealed type is "Never"
    -gh_4952_body_0.py:14: error: "Never" has no attribute "method"  [attr-defined]
    +gh_4952_body_0.py:13: note: Revealed type is "R`-1"
    +gh_4952_body_0.py:14: error: "R" has no attribute "method"  [attr-defined]
     Found 1 error in 1 file (checked 1 source file)
    
    Found 13 issues with different output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions