Skip to content

Commit f2191f6

Browse files
author
Max Rozentsveyg
committed
Redefine _KT and _VT
1 parent b90b70e commit f2191f6

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

third_party/2and3/boto/utils.pyi

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import time
66

77
import boto.connection
88
from typing import (
9-
_KT,
10-
_VT,
119
Any,
1210
Callable,
1311
Dict,
@@ -18,9 +16,13 @@ from typing import (
1816
Sequence,
1917
Tuple,
2018
Type,
19+
TypeVar,
2120
Union,
2221
)
2322

23+
_KT = TypeVar('_KT')
24+
_VT = TypeVar('_VT')
25+
2426
_Provider = Any # TODO replace this with boto.provider.Provider once stubs exist
2527
_LockType = Any # TODO replace this with _thread.LockType once stubs exist
2628

@@ -63,7 +65,7 @@ def get_instance_metadata(
6365
url: str = ...,
6466
data: str = ...,
6567
timeout: Optional[int] = ...,
66-
num_retries: int = ...
68+
num_retries: int = ...,
6769
) -> Optional[LazyLoadMetadata]: ...
6870
def get_instance_identity(
6971
version: str = ...,
@@ -138,11 +140,13 @@ class AuthSMTPHandler(logging.handlers.SMTPHandler):
138140
def emit(self, record: logging.LogRecord) -> None: ...
139141

140142
class LRUCache(Dict[_KT, _VT]):
143+
__KT = _KT
144+
__VT = _VT
141145
class _Item:
142146
previous = ... # type: Optional[LRUCache._Item]
143-
key = ... # type: _KT
144-
value = ... # type: _VT
145-
def __init__(self, key: _KT, value: _VT) -> None: ...
147+
key = ... # type: LRUCache.__KT
148+
value = ... # type: LRUCache.__VT
149+
def __init__(self, key: LRUCache.__KT, value: LRUCache.__VT) -> None: ...
146150

147151
capacity = ... # type: int
148152
head = ... # type: Optional[LRUCache._Item]

0 commit comments

Comments
 (0)