stdlib: Improve many __iter__ and constructor methods (#7112)

This commit is contained in:
Alex Waygood
2022-02-02 18:14:57 +00:00
committed by GitHub
parent b327f64d9a
commit 7ccbbdb30a
11 changed files with 36 additions and 24 deletions

View File

@@ -2,6 +2,7 @@ import bz2
import io
import sys
from _typeshed import Self, StrOrBytesPath, StrPath
from builtins import type as Type # alias to avoid name clashes with fields named "type"
from collections.abc import Callable, Iterable, Iterator, Mapping
from gzip import _ReadableFileobj as _GzipReadableFileobj, _WritableFileobj as _GzipWritableFileobj
from types import TracebackType
@@ -339,9 +340,9 @@ class TarInfo:
pax_headers: Mapping[str, str]
def __init__(self, name: str = ...) -> None: ...
@classmethod
def frombuf(cls, buf: bytes, encoding: str, errors: str) -> TarInfo: ...
def frombuf(cls: Type[Self], buf: bytes, encoding: str, errors: str) -> Self: ...
@classmethod
def fromtarfile(cls, tarfile: TarFile) -> TarInfo: ...
def fromtarfile(cls: Type[Self], tarfile: TarFile) -> Self: ...
@property
def linkpath(self) -> str: ...
@linkpath.setter