@@ -31,8 +31,8 @@ def __init__(
3131 self ,
3232 key_cast : KT_cast = None ,
3333 value_cast : VT_cast = None ,
34- * args ,
35- ** kwargs ,
34+ * args : DictUpdateArgs ,
35+ ** kwargs : VT ,
3636 ) -> None :
3737 self ._value_cast = value_cast
3838 self ._key_cast = key_cast
@@ -53,7 +53,7 @@ def __setitem__(self, key: Any, value: Any) -> None:
5353 return super ().__setitem__ (key , value )
5454
5555
56- class CastedDict (CastedDictBase ):
56+ class CastedDict (CastedDictBase [ KT , VT ] ):
5757 '''
5858 Custom dictionary that casts keys and values to the specified typing.
5959
@@ -88,14 +88,14 @@ class CastedDict(CastedDictBase):
8888 {1: 2, '3': '4', '5': '6', '7': '8'}
8989 '''
9090
91- def __setitem__ (self , key , value ) :
91+ def __setitem__ (self , key : Any , value : Any ) -> None :
9292 if self ._value_cast is not None :
9393 value = self ._value_cast (value )
9494
9595 super ().__setitem__ (key , value )
9696
9797
98- class LazyCastedDict (CastedDictBase ):
98+ class LazyCastedDict (CastedDictBase [ KT , VT ] ):
9999 '''
100100 Custom dictionary that casts keys and lazily casts values to the specified
101101 typing. Note that the values are cast only when they are accessed and
@@ -141,13 +141,13 @@ class LazyCastedDict(CastedDictBase):
141141 '4'
142142 '''
143143
144- def __setitem__ (self , key , value ) :
144+ def __setitem__ (self , key : Any , value : Any ) -> None :
145145 if self ._key_cast is not None :
146146 key = self ._key_cast (key )
147147
148148 super ().__setitem__ (key , value )
149149
150- def __getitem__ (self , key ) -> VT :
150+ def __getitem__ (self , key : Any ) -> VT :
151151 if self ._key_cast is not None :
152152 key = self ._key_cast (key )
153153
0 commit comments