Fix return annotations of several methods that return self at runtime (#7070)

This commit is contained in:
Alex Waygood
2022-01-29 01:37:49 +00:00
committed by GitHub
parent 749d3db815
commit 33ecb68603
8 changed files with 19 additions and 15 deletions

View File

@@ -17,6 +17,7 @@ from _csv import (
unregister_dialect as unregister_dialect,
writer as writer,
)
from _typeshed import Self
from collections.abc import Collection, Iterable, Iterator, Mapping, Sequence
from typing import Any, Generic, TypeVar, overload
@@ -75,7 +76,7 @@ class DictReader(Generic[_T], Iterator[_DictReadMapping[_T, str]]):
*args: Any,
**kwds: Any,
) -> None: ...
def __iter__(self) -> DictReader[_T]: ...
def __iter__(self: Self) -> Self: ...
def __next__(self) -> _DictReadMapping[_T, str]: ...
class DictWriter(Generic[_T]):