We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
AnnotationTemplate
_ItemStorage
1 parent 6d9a350 commit c1a4b55Copy full SHA for c1a4b55
1 file changed
pyannotating.py
@@ -53,6 +53,12 @@ def __ror__(self, other: Any) -> Union:
53
return Union[other, self]
54
55
56
+class _ItemStorage(Protocol):
57
+ @abstractmethod
58
+ def __getitem__(self, key: Any) -> Any:
59
+ pass
60
+
61
62
class AnnotationTemplate(_AnnotationFactory):
63
"""
64
_AnnotationFactory class delegating the construction of another factory's
@@ -67,8 +73,8 @@ class AnnotationTemplate(_AnnotationFactory):
67
73
annotations.
68
74
69
75
70
- def __init__(self, original_factory: Mapping, annotations: Iterable):
71
76
self._original_factory = original_factory
77
+ def __init__(self, factory: _ItemStorage, annotations: list):
72
78
self._annotations = tuple(annotations)
79
80
def __repr__(self) -> str:
0 commit comments