mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Use PEP 604 syntax wherever possible (#7493)
This commit is contained in:
@@ -2,7 +2,7 @@ import sys
|
||||
import types
|
||||
from _typeshed import Self
|
||||
from opcode import * # `dis` re-exports it as a part of public API
|
||||
from typing import IO, Any, Callable, Iterator, NamedTuple, Union
|
||||
from typing import IO, Any, Callable, Iterator, NamedTuple
|
||||
|
||||
__all__ = [
|
||||
"code_info",
|
||||
@@ -34,8 +34,8 @@ __all__ = [
|
||||
|
||||
# Strictly this should not have to include Callable, but mypy doesn't use FunctionType
|
||||
# for functions (python/mypy#3171)
|
||||
_HaveCodeType = Union[types.MethodType, types.FunctionType, types.CodeType, type, Callable[..., Any]]
|
||||
_HaveCodeOrStringType = Union[_HaveCodeType, str, bytes]
|
||||
_HaveCodeType = types.MethodType | types.FunctionType | types.CodeType | type | Callable[..., Any]
|
||||
_HaveCodeOrStringType = _HaveCodeType | str | bytes
|
||||
|
||||
class Instruction(NamedTuple):
|
||||
opname: str
|
||||
|
||||
Reference in New Issue
Block a user