66from io import BytesIO , StringIO , TextIOWrapper
77from typing import (
88 TYPE_CHECKING ,
9- Any ,
109 Callable ,
1110 Dict ,
1211 Generator ,
@@ -55,7 +54,7 @@ def open(
5554 self ,
5655 mode : str = "r" ,
5756 encoding : str = None ,
58- key : tuple = None ,
57+ key : Optional [ Tuple [ str , ...]] = None ,
5958 raw : bool = True ,
6059 rev : Optional [str ] = None ,
6160 ** kwargs ,
@@ -67,14 +66,16 @@ def open(
6766 if self .backend is not None :
6867 try :
6968 if rev :
69+ # pylint: disable-next=protected-access
7070 commit , _ref = self .backend ._resolve_refish (rev )
7171 else :
7272 pass
7373 if raw :
7474 blob_kwargs = {}
7575 else :
76+ assert key is not None
7677 path = "/" .join (key )
77- blob_kwargs : Dict [ str , Any ] = {
78+ blob_kwargs = {
7879 "as_path" : path ,
7980 "commit_id" : commit .oid ,
8081 }
@@ -123,21 +124,21 @@ class Pygit2Config(Config):
123124 def __init__ (self , config : "_Pygit2Config" ):
124125 self ._config = config
125126
126- def _key (self , section : Tuple [str ], name : str ) -> str :
127+ def _key (self , section : Tuple [str , ... ], name : str ) -> str :
127128 return "." .join (section + (name ,))
128129
129- def get (self , section : Tuple [str ], name : str ) -> str :
130+ def get (self , section : Tuple [str , ... ], name : str ) -> str :
130131 return self ._config [self ._key (section , name )]
131132
132- def get_bool (self , section : Tuple [str ], name : str ) -> bool :
133+ def get_bool (self , section : Tuple [str , ... ], name : str ) -> bool :
133134 from pygit2 import GitError
134135
135136 try :
136137 return self ._config .get_bool (self ._key (section , name ))
137138 except GitError as exc :
138139 raise ValueError ("invalid boolean config entry" ) from exc
139140
140- def get_multivar (self , section : Tuple [str ], name : str ) -> Iterator [str ]:
141+ def get_multivar (self , section : Tuple [str , ... ], name : str ) -> Iterator [str ]:
141142 from pygit2 import GitError
142143
143144 try :
0 commit comments