fixed typo
This commit is contained in:
parent
8aa4fc18a7
commit
2484f772b3
@ -106,13 +106,13 @@ class Derived(Base):
|
|||||||
def foo(self) -> int:
|
def foo(self) -> int:
|
||||||
return 2
|
return 2
|
||||||
|
|
||||||
def bar(x: [Base]) -> int:
|
def bar(x: list[Base]) -> int:
|
||||||
sum = 0
|
sum = 0
|
||||||
for v in x:
|
for v in x:
|
||||||
sum += v.foo()
|
sum += v.foo()
|
||||||
return sum
|
return sum
|
||||||
|
|
||||||
# incorrect, the type signature of the list is `[virtual[Base]]`
|
# incorrect, the type signature of the list is `list[virtual[Base]]`
|
||||||
bar([Base(), Derived()])
|
bar([Base(), Derived()])
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -124,7 +124,7 @@ inlining etc.
|
|||||||
|
|
||||||
Example:
|
Example:
|
||||||
```py
|
```py
|
||||||
def bar2(x: [virtual[Base]]) -> int:
|
def bar2(x: list[virtual[Base]]) -> int:
|
||||||
sum = 0
|
sum = 0
|
||||||
for v in x:
|
for v in x:
|
||||||
sum += v.foo()
|
sum += v.foo()
|
||||||
|
Loading…
Reference in New Issue
Block a user