Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Do not ignore generic type args when checking multiple inheritance compatibility#18270

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Changes from1 commit
Commits
Show all changes
11 commits
Select commitHold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
Include a testcase from review
  • Loading branch information
@sterliakov
sterliakov committedDec 10, 2024
commitc81c38d1a88a81236c09e673c018daa79b0c6c83
15 changes: 15 additions & 0 deletionstest-data/unit/check-generic-subtyping.test
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1090,3 +1090,18 @@ class C5(A2[U], B[T]): pass # E: Definition of "fn" in base class "A" is incomp
# E: Definition of "x" in base class "A" is incompatible with definition in base class "B"

[builtins fixtures/tuple.pyi]

[case testMultipleInheritanceNestedTypeVarPropagation]
from typing import Generic, TypeVar

T = TypeVar("T")

class A(Generic[T]):
foo: T
class B(A[str]): ...
class C(B): ...
class D(C): ...

class Bad(D, A[T]): ... # E: Definition of "foo" in base class "A" is incompatible with definition in base class "A"
class Good(D, A[str]): ... # OK
[builtins fixtures/tuple.pyi]
Loading

[8]ページ先頭

©2009-2025 Movatter.jp