Skip to content

Commit c1a4b55

Browse files
committed
AnnotationTemplate annotates the input factory as _ItemStorage
1 parent 6d9a350 commit c1a4b55

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

pyannotating.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ def __ror__(self, other: Any) -> Union:
5353
return Union[other, self]
5454

5555

56+
class _ItemStorage(Protocol):
57+
@abstractmethod
58+
def __getitem__(self, key: Any) -> Any:
59+
pass
60+
61+
5662
class AnnotationTemplate(_AnnotationFactory):
5763
"""
5864
_AnnotationFactory class delegating the construction of another factory's
@@ -67,8 +73,8 @@ class AnnotationTemplate(_AnnotationFactory):
6773
annotations.
6874
"""
6975

70-
def __init__(self, original_factory: Mapping, annotations: Iterable):
7176
self._original_factory = original_factory
77+
def __init__(self, factory: _ItemStorage, annotations: list):
7278
self._annotations = tuple(annotations)
7379

7480
def __repr__(self) -> str:

0 commit comments

Comments
 (0)