Skip to content

Commit bfeaa46

Browse files
committed
nits
1 parent a5c0c88 commit bfeaa46

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

crates/ty_python_semantic/resources/mdtest/generics/pep695/classes.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,6 @@ If either method comes from a generic base class, we don't currently use its inf
315315
to specialize the class.
316316

317317
```py
318-
from typing import Literal
319-
320318
class C[T, U]:
321319
def __new__(cls, *args, **kwargs) -> "C[T, U]":
322320
return object.__new__(cls)
@@ -330,8 +328,6 @@ reveal_type(D(1)) # revealed: D[Literal[1]]
330328
### Generic class inherits `__init__` from generic base class
331329

332330
```py
333-
from typing import Literal
334-
335331
class C[T, U]:
336332
def __init__(self, t: T, u: U) -> None: ...
337333

crates/ty_python_semantic/src/types/generics.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ impl<'db> GenericContextTypeVar<'db> {
195195
}
196196
}
197197

198+
/// Returns `true` if this type variable is inherited from the generic context of an
199+
/// outer class.
198200
pub fn is_inherited(&self) -> bool {
199201
self.is_inherited
200202
}

0 commit comments

Comments
 (0)