mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-03-15 03:06:46 +08:00
Big diff: Use new "|" union syntax (#5872)
This commit is contained in:
@@ -2,12 +2,12 @@ import sys
|
||||
from _typeshed import SupportsGetItem, SupportsItemAccess
|
||||
from builtins import type as _type
|
||||
from collections.abc import Iterable, Iterator, Mapping
|
||||
from typing import IO, Any, Optional, Protocol, TypeVar, Union
|
||||
from typing import IO, Any, Protocol, TypeVar
|
||||
|
||||
_T = TypeVar("_T", bound=FieldStorage)
|
||||
|
||||
def parse(
|
||||
fp: Optional[IO[Any]] = ...,
|
||||
fp: IO[Any] | None = ...,
|
||||
environ: SupportsItemAccess[str, str] = ...,
|
||||
keep_blank_values: bool = ...,
|
||||
strict_parsing: bool = ...,
|
||||
@@ -38,14 +38,14 @@ def print_directory() -> None: ...
|
||||
def print_environ_usage() -> None: ...
|
||||
|
||||
if sys.version_info < (3, 8):
|
||||
def escape(s: str, quote: Optional[bool] = ...) -> str: ...
|
||||
def escape(s: str, quote: bool | None = ...) -> str: ...
|
||||
|
||||
class MiniFieldStorage:
|
||||
# The first five "Any" attributes here are always None, but mypy doesn't support that
|
||||
filename: Any
|
||||
list: Any
|
||||
type: Any
|
||||
file: Optional[IO[bytes]]
|
||||
file: IO[bytes] | None
|
||||
type_options: dict[Any, Any]
|
||||
disposition: Any
|
||||
disposition_options: dict[Any, Any]
|
||||
@@ -58,40 +58,40 @@ class MiniFieldStorage:
|
||||
_list = list
|
||||
|
||||
class FieldStorage(object):
|
||||
FieldStorageClass: Optional[_type]
|
||||
FieldStorageClass: _type | None
|
||||
keep_blank_values: int
|
||||
strict_parsing: int
|
||||
qs_on_post: Optional[str]
|
||||
qs_on_post: str | None
|
||||
headers: Mapping[str, str]
|
||||
fp: IO[bytes]
|
||||
encoding: str
|
||||
errors: str
|
||||
outerboundary: bytes
|
||||
bytes_read: int
|
||||
limit: Optional[int]
|
||||
limit: int | None
|
||||
disposition: str
|
||||
disposition_options: dict[str, str]
|
||||
filename: Optional[str]
|
||||
file: Optional[IO[bytes]]
|
||||
filename: str | None
|
||||
file: IO[bytes] | None
|
||||
type: str
|
||||
type_options: dict[str, str]
|
||||
innerboundary: bytes
|
||||
length: int
|
||||
done: int
|
||||
list: Optional[_list[Any]]
|
||||
value: Union[None, bytes, _list[Any]]
|
||||
list: _list[Any] | None
|
||||
value: None | bytes | _list[Any]
|
||||
def __init__(
|
||||
self,
|
||||
fp: Optional[IO[Any]] = ...,
|
||||
headers: Optional[Mapping[str, str]] = ...,
|
||||
fp: IO[Any] | None = ...,
|
||||
headers: Mapping[str, str] | None = ...,
|
||||
outerboundary: bytes = ...,
|
||||
environ: SupportsGetItem[str, str] = ...,
|
||||
keep_blank_values: int = ...,
|
||||
strict_parsing: int = ...,
|
||||
limit: Optional[int] = ...,
|
||||
limit: int | None = ...,
|
||||
encoding: str = ...,
|
||||
errors: str = ...,
|
||||
max_num_fields: Optional[int] = ...,
|
||||
max_num_fields: int | None = ...,
|
||||
separator: str = ...,
|
||||
) -> None: ...
|
||||
def __enter__(self: _T) -> _T: ...
|
||||
|
||||
Reference in New Issue
Block a user