Add check_untyped_defs (#15510)
* Add check_untyped_defs * Change to regular if-else
This commit is contained in:
1 parent
7d7c2104ea
commit
24d2261060
15 files changed
+70
-44
No files matched your search
@@ -13,7 +13,8 @@ from functools import wraps
|
||||
from types import MappingProxyType
|
||||
from unicodedata import normalize
|
||||
|
||||
from typing import Any, Optional, TypeVar, Callable, KeysView, Union, Iterable
|
||||
from typing import (Any, Optional, TypeVar, Callable, KeysView, Union, # noqa
|
||||
Iterable, List, Mapping)
|
||||
|
||||
from .dt import as_local, utcnow
|
||||
|
||||
@@ -150,9 +151,9 @@ class OrderedSet(MutableSet):
|
||||
|
||||
def __init__(self, iterable=None):
|
||||
"""Initialize the set."""
|
||||
self.end = end = []
|
||||
end += [None, end, end] # sentinel node for doubly linked list
|
||||
self.map = {} # key --> [key, prev, next]
|
||||
self.end = end = [] # type: List[Any]
|
||||
end += [None, end, end] # sentinel node for doubly linked list
|
||||
self.map = {} # type: Mapping[List, Any] # key --> [key, prev, next]
|
||||
if iterable is not None:
|
||||
self |= iterable
|
||||
|
||||
|
||||
Reference in new issue
Block a user