Use _typeshed.FileDescriptorOrPath in stubs (#9695)

This commit is contained in:
Avasam
2023-02-09 02:30:19 -05:00
committed by GitHub
parent 6d535bf0a3
commit 372073d35b
13 changed files with 39 additions and 53 deletions

View File

@@ -1,5 +1,5 @@
import _csv
from _typeshed import StrOrBytesPath
from _typeshed import FileDescriptorOrPath, StrOrBytesPath
from collections.abc import Iterable
from typing import Any, BinaryIO, TextIO
from typing_extensions import TypeAlias
@@ -12,21 +12,21 @@ IAB_INDEX: _INDEX
class FileIndexer(Subscriber):
writer: _csv._writer
def __init__(self, index_file: TextIO | StrOrBytesPath | int) -> None: ...
def __init__(self, index_file: TextIO | FileDescriptorOrPath) -> None: ...
def update(self, data: Iterable[Any]) -> None: ...
class OUIIndexParser(Publisher):
fh: BinaryIO
def __init__(self, ieee_file: BinaryIO | StrOrBytesPath | int) -> None: ...
def __init__(self, ieee_file: BinaryIO | FileDescriptorOrPath) -> None: ...
def parse(self) -> None: ...
class IABIndexParser(Publisher):
fh: BinaryIO
def __init__(self, ieee_file: BinaryIO | StrOrBytesPath | int) -> None: ...
def __init__(self, ieee_file: BinaryIO | FileDescriptorOrPath) -> None: ...
def parse(self) -> None: ...
def create_index_from_registry(
registry_fh: BinaryIO | StrOrBytesPath | int, index_path: StrOrBytesPath, parser: type[OUIIndexParser] | type[IABIndexParser]
registry_fh: BinaryIO | FileDescriptorOrPath, index_path: StrOrBytesPath, parser: type[OUIIndexParser] | type[IABIndexParser]
) -> None: ...
def create_indices() -> None: ...
def load_index(index: _INDEX, fp: Iterable[bytes]) -> None: ...