mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Big diff: Use new "|" union syntax (#5872)
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import sys
|
||||
from _typeshed import Self, StrOrBytesPath
|
||||
from typing import IO, Any, AnyStr, Callable, Generic, Iterable, Iterator, Union
|
||||
from typing import IO, Any, AnyStr, Callable, Generic, Iterable, Iterator
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from types import GenericAlias
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
def input(
|
||||
files: Union[StrOrBytesPath, Iterable[StrOrBytesPath], None] = ...,
|
||||
files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ...,
|
||||
inplace: bool = ...,
|
||||
backup: str = ...,
|
||||
*,
|
||||
@@ -19,7 +19,7 @@ if sys.version_info >= (3, 10):
|
||||
|
||||
elif sys.version_info >= (3, 8):
|
||||
def input(
|
||||
files: Union[StrOrBytesPath, Iterable[StrOrBytesPath], None] = ...,
|
||||
files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ...,
|
||||
inplace: bool = ...,
|
||||
backup: str = ...,
|
||||
*,
|
||||
@@ -29,7 +29,7 @@ elif sys.version_info >= (3, 8):
|
||||
|
||||
else:
|
||||
def input(
|
||||
files: Union[StrOrBytesPath, Iterable[StrOrBytesPath], None] = ...,
|
||||
files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = ...,
|
||||
inplace: bool = ...,
|
||||
backup: str = ...,
|
||||
bufsize: int = ...,
|
||||
@@ -50,7 +50,7 @@ class FileInput(Iterable[AnyStr], Generic[AnyStr]):
|
||||
if sys.version_info >= (3, 10):
|
||||
def __init__(
|
||||
self,
|
||||
files: Union[None, StrOrBytesPath, Iterable[StrOrBytesPath]] = ...,
|
||||
files: None | StrOrBytesPath | Iterable[StrOrBytesPath] = ...,
|
||||
inplace: bool = ...,
|
||||
backup: str = ...,
|
||||
*,
|
||||
@@ -62,7 +62,7 @@ class FileInput(Iterable[AnyStr], Generic[AnyStr]):
|
||||
elif sys.version_info >= (3, 8):
|
||||
def __init__(
|
||||
self,
|
||||
files: Union[None, StrOrBytesPath, Iterable[StrOrBytesPath]] = ...,
|
||||
files: None | StrOrBytesPath | Iterable[StrOrBytesPath] = ...,
|
||||
inplace: bool = ...,
|
||||
backup: str = ...,
|
||||
*,
|
||||
@@ -72,7 +72,7 @@ class FileInput(Iterable[AnyStr], Generic[AnyStr]):
|
||||
else:
|
||||
def __init__(
|
||||
self,
|
||||
files: Union[None, StrOrBytesPath, Iterable[StrOrBytesPath]] = ...,
|
||||
files: None | StrOrBytesPath | Iterable[StrOrBytesPath] = ...,
|
||||
inplace: bool = ...,
|
||||
backup: str = ...,
|
||||
bufsize: int = ...,
|
||||
|
||||
Reference in New Issue
Block a user