mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Use PEP 585 syntax in Python 2, protobuf & _ast stubs, where possible (#6949)
This commit is contained in:
@@ -13,17 +13,17 @@ from opcode import (
|
||||
opmap as opmap,
|
||||
opname as opname,
|
||||
)
|
||||
from typing import Any, Callable, Dict, Iterator, List, Tuple, Union
|
||||
from typing import Any, Callable, Iterator, Union
|
||||
|
||||
# Strictly this should not have to include Callable, but mypy doesn't use FunctionType
|
||||
# for functions (python/mypy#3171)
|
||||
_have_code = Union[types.MethodType, types.FunctionType, types.CodeType, type, Callable[..., Any]]
|
||||
_have_code_or_string = Union[_have_code, str, bytes]
|
||||
|
||||
COMPILER_FLAG_NAMES: Dict[int, str]
|
||||
COMPILER_FLAG_NAMES: dict[int, str]
|
||||
|
||||
def findlabels(code: _have_code) -> List[int]: ...
|
||||
def findlinestarts(code: _have_code) -> Iterator[Tuple[int, int]]: ...
|
||||
def findlabels(code: _have_code) -> list[int]: ...
|
||||
def findlinestarts(code: _have_code) -> Iterator[tuple[int, int]]: ...
|
||||
def dis(x: _have_code_or_string = ...) -> None: ...
|
||||
def distb(tb: types.TracebackType = ...) -> None: ...
|
||||
def disassemble(co: _have_code, lasti: int = ...) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user