Use PEP 585 syntax wherever possible (#6717)

This commit is contained in:
Alex Waygood
2021-12-28 10:31:43 +00:00
committed by GitHub
parent e6cb341d94
commit 8d5d2520ac
237 changed files with 966 additions and 1069 deletions

View File

@@ -1,10 +1,10 @@
import sys
from collections import OrderedDict
from typing import Any, Dict
from typing import Any
entitiesTrie: Any
if sys.version_info >= (3, 7):
attributeMap = Dict[Any, Any]
attributeMap = dict[Any, Any]
else:
attributeMap = OrderedDict[Any, Any]

View File

@@ -1,9 +1,9 @@
from collections.abc import Mapping
from typing import Any, Dict
from typing import Any
supports_lone_surrogates: bool
class MethodDispatcher(Dict[Any, Any]):
class MethodDispatcher(dict[Any, Any]):
default: Any
def __init__(self, items=...) -> None: ...
def __getitem__(self, key): ...

View File

@@ -1,4 +1,4 @@
from typing import Any, List
from typing import Any
Marker: Any
listElementsMap: Any
@@ -18,7 +18,7 @@ class Node:
def cloneNode(self) -> None: ...
def hasContent(self) -> None: ...
class ActiveFormattingElements(List[Any]):
class ActiveFormattingElements(list[Any]):
def append(self, node) -> None: ...
def nodesEqual(self, node1, node2): ...