mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Use PEP 585 syntax in Python 2, protobuf & _ast stubs, where possible (#6949)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
from types import ModuleType
|
||||
from typing import Any, Container, Dict, Iterable, List, Sequence, Set, Tuple, Type
|
||||
from typing import Any, Container, Iterable, Sequence
|
||||
from typing_extensions import Literal
|
||||
|
||||
if sys.platform == "win32":
|
||||
@@ -24,19 +24,19 @@ if sys.platform == "win32":
|
||||
class Table:
|
||||
|
||||
name: str
|
||||
fields: List[Tuple[int, str, int]]
|
||||
fields: list[tuple[int, str, int]]
|
||||
def __init__(self, name: str) -> None: ...
|
||||
def add_field(self, index: int, name: str, type: int) -> None: ...
|
||||
def sql(self) -> str: ...
|
||||
def create(self, db: _Database) -> None: ...
|
||||
class _Unspecified: ...
|
||||
def change_sequence(
|
||||
seq: Sequence[Tuple[str, str | None, int]],
|
||||
seq: Sequence[tuple[str, str | None, int]],
|
||||
action: str,
|
||||
seqno: int | Type[_Unspecified] = ...,
|
||||
cond: str | Type[_Unspecified] = ...,
|
||||
seqno: int | type[_Unspecified] = ...,
|
||||
cond: str | type[_Unspecified] = ...,
|
||||
) -> None: ...
|
||||
def add_data(db: _Database, table: str, values: Iterable[Tuple[Any, ...]]) -> None: ...
|
||||
def add_data(db: _Database, table: str, values: Iterable[tuple[Any, ...]]) -> None: ...
|
||||
def add_stream(db: _Database, name: str, path: str) -> None: ...
|
||||
def init_database(
|
||||
name: str, schema: ModuleType, ProductName: str, ProductCode: str, ProductVersion: str, Manufacturer: str
|
||||
@@ -47,14 +47,14 @@ if sys.platform == "win32":
|
||||
class CAB:
|
||||
|
||||
name: str
|
||||
files: List[Tuple[str, str]]
|
||||
filenames: Set[str]
|
||||
files: list[tuple[str, str]]
|
||||
filenames: set[str]
|
||||
index: int
|
||||
def __init__(self, name: str) -> None: ...
|
||||
def gen_id(self, file: str) -> str: ...
|
||||
def append(self, full: str, file: str, logical: str) -> Tuple[int, str]: ...
|
||||
def append(self, full: str, file: str, logical: str) -> tuple[int, str]: ...
|
||||
def commit(self, db: _Database) -> None: ...
|
||||
_directories: Set[str]
|
||||
_directories: set[str]
|
||||
class Directory:
|
||||
|
||||
db: _Database
|
||||
@@ -63,9 +63,9 @@ if sys.platform == "win32":
|
||||
physical: str
|
||||
logical: str
|
||||
component: str | None
|
||||
short_names: Set[str]
|
||||
ids: Set[str]
|
||||
keyfiles: Dict[str, str]
|
||||
short_names: set[str]
|
||||
ids: set[str]
|
||||
keyfiles: dict[str, str]
|
||||
componentflags: int | None
|
||||
absolute: str
|
||||
def __init__(
|
||||
@@ -88,7 +88,7 @@ if sys.platform == "win32":
|
||||
) -> None: ...
|
||||
def make_short(self, file: str) -> str: ...
|
||||
def add_file(self, file: str, src: str | None = ..., version: str | None = ..., language: str | None = ...) -> str: ...
|
||||
def glob(self, pattern: str, exclude: Container[str] | None = ...) -> List[str]: ...
|
||||
def glob(self, pattern: str, exclude: Container[str] | None = ...) -> list[str]: ...
|
||||
def remove_pyc(self) -> None: ...
|
||||
class Binary:
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import sys
|
||||
from typing import List, Tuple
|
||||
|
||||
if sys.platform == "win32":
|
||||
from . import Table
|
||||
@@ -90,6 +89,6 @@ if sys.platform == "win32":
|
||||
Upgrade: Table
|
||||
Verb: Table
|
||||
|
||||
tables: List[Table]
|
||||
tables: list[Table]
|
||||
|
||||
_Validation_records: List[Tuple[str, str, str, int | None, int | None, str | None, int | None, str | None, str | None, str]]
|
||||
_Validation_records: list[tuple[str, str, str, int | None, int | None, str | None, int | None, str | None, str | None, str]]
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import sys
|
||||
from typing import List, Optional, Tuple
|
||||
from typing import Optional
|
||||
|
||||
if sys.platform == "win32":
|
||||
|
||||
_SequenceType = List[Tuple[str, Optional[str], int]]
|
||||
_SequenceType = list[tuple[str, Optional[str], int]]
|
||||
|
||||
AdminExecuteSequence: _SequenceType
|
||||
AdminUISequence: _SequenceType
|
||||
@@ -11,4 +11,4 @@ if sys.platform == "win32":
|
||||
InstallExecuteSequence: _SequenceType
|
||||
InstallUISequence: _SequenceType
|
||||
|
||||
tables: List[str]
|
||||
tables: list[str]
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import sys
|
||||
from typing import List, Tuple
|
||||
|
||||
if sys.platform == "win32":
|
||||
|
||||
ActionText: List[Tuple[str, str, str | None]]
|
||||
UIText: List[Tuple[str, str | None]]
|
||||
ActionText: list[tuple[str, str, str | None]]
|
||||
UIText: list[tuple[str, str | None]]
|
||||
|
||||
tables: List[str]
|
||||
tables: list[str]
|
||||
|
||||
Reference in New Issue
Block a user