Use PEP 604 syntax wherever possible (#7493)

This commit is contained in:
Alex Waygood authored and GitHub committed 2022-03-16 16:01:33 +01:00
1 parent 15e21a8dc1
commit 3ab250eec8
174 files changed
+472 -490

No files matched your search

+3 -3
View File
@@ -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