Style: prefer type[Foo | Bar] over type[Foo] | type[Bar] (#10039)

This commit is contained in:
Alex Waygood
2023-04-13 10:34:53 +01:00
committed by GitHub
parent 084f555793
commit 2279886964
5 changed files with 45 additions and 43 deletions

View File

@@ -35,16 +35,16 @@ class IAB(BaseIdentifier):
class EUI(BaseIdentifier):
def __init__(
self, addr: EUI | int | str, version: int | None = None, dialect: type[mac_eui48] | type[eui64_base] | None = None
self, addr: EUI | int | str, version: int | None = None, dialect: type[mac_eui48 | eui64_base] | None = None
) -> None: ...
@property
def value(self) -> int: ...
@value.setter
def value(self, value: str | SupportsInt | SupportsIndex) -> None: ...
@property
def dialect(self) -> type[mac_eui48] | type[eui64_base]: ...
def dialect(self) -> type[mac_eui48 | eui64_base]: ...
@dialect.setter
def dialect(self, value: type[mac_eui48] | type[eui64_base] | None) -> None: ...
def dialect(self, value: type[mac_eui48 | eui64_base] | None) -> None: ...
@property
def oui(self) -> OUI: ...
@property
@@ -81,4 +81,4 @@ class EUI(BaseIdentifier):
def ipv6_link_local(self) -> IPAddress: ...
@property
def info(self) -> DictDotLookup: ...
def format(self, dialect: type[mac_eui48] | type[eui64_base] | None = None) -> str: ...
def format(self, dialect: type[mac_eui48 | eui64_base] | None = None) -> str: ...

View File

@@ -26,7 +26,7 @@ class IABIndexParser(Publisher):
def parse(self) -> None: ...
def create_index_from_registry(
registry_fh: BinaryIO | FileDescriptorOrPath, index_path: StrOrBytesPath, parser: type[OUIIndexParser] | type[IABIndexParser]
registry_fh: BinaryIO | FileDescriptorOrPath, index_path: StrOrBytesPath, parser: type[OUIIndexParser | IABIndexParser]
) -> None: ...
def create_indices() -> None: ...
def load_index(index: _INDEX, fp: Iterable[bytes]) -> None: ...