Skip to content

Commit bdc4dc1

Browse files
authored
Additional tests for undefined-variable with PEP 695 syntax (#10502)
1 parent b6ac272 commit bdc4dc1

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
# pylint: disable=missing-function-docstring,missing-module-docstring,missing-class-docstring,too-few-public-methods
2+
# pylint: disable=unused-argument
23

34
def f[T](a: T) -> T:
45
print(a)
56

6-
class ChildClass[T, *Ts, **P]:
7+
class SomeClass[T, *Ts, **P]:
78
def __init__(self, value: T):
89
self.value = value
10+
11+
12+
class Parent[T]:
13+
def __init__(self, x: T, y: S) -> None: # [undefined-variable]
14+
...
15+
16+
class Child[T](Parent[T, S]): # [undefined-variable]
17+
...
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
undefined-variable:13:32:13:33:Parent.__init__:Undefined variable 'S':UNDEFINED
2+
undefined-variable:16:25:16:26:Child:Undefined variable 'S':UNDEFINED

0 commit comments

Comments
 (0)