@@ -20,17 +20,17 @@ def __init__(self, mapping: "Multiaddr") -> None:
2020 self ._mapping = mapping
2121 super ().__init__ (mapping )
2222
23- def __contains__ (self , proto : object ) -> bool :
24- proto = self ._mapping .registry .find (proto )
23+ def __contains__ (self , key : object ) -> bool :
24+ proto = self ._mapping .registry .find (key )
2525 return collections .abc .Sequence .__contains__ (self , proto )
2626
27- def __getitem__ (self , idx : int | slice ) -> Any | Sequence [Any ]:
28- if isinstance (idx , slice ):
29- return list (self )[idx ]
30- if idx < 0 :
31- idx = len (self ) + idx
27+ def __getitem__ (self , index : int | slice ) -> Any | Sequence [Any ]:
28+ if isinstance (index , slice ):
29+ return list (self )[index ]
30+ if index < 0 :
31+ index = len (self ) + index
3232 for idx2 , proto in enumerate (self ):
33- if idx2 == idx :
33+ if idx2 == index :
3434 return proto
3535 raise IndexError ("Protocol list index out of range" )
3636
@@ -49,26 +49,26 @@ def __init__(self, mapping: "Multiaddr") -> None:
4949 self ._mapping = mapping
5050 super ().__init__ (mapping )
5151
52- def __contains__ (self , item : object ) -> bool :
53- if not isinstance (item , tuple ) or len (item ) != 2 :
52+ def __contains__ (self , value : object ) -> bool :
53+ if not isinstance (value , tuple ) or len (value ) != 2 :
5454 return False
55- proto , value = item
55+ proto , val = value
5656 proto = self ._mapping .registry .find (proto )
57- return collections .abc .Sequence .__contains__ (self , (proto , value ))
57+ return collections .abc .Sequence .__contains__ (self , (proto , val ))
5858
5959 @overload
60- def __getitem__ (self , idx : int ) -> tuple [Any , Any ]: ...
60+ def __getitem__ (self , index : int ) -> tuple [Any , Any ]: ...
6161
6262 @overload
63- def __getitem__ (self , idx : slice ) -> Sequence [tuple [Any , Any ]]: ...
63+ def __getitem__ (self , index : slice ) -> Sequence [tuple [Any , Any ]]: ...
6464
65- def __getitem__ (self , idx : int | slice ) -> tuple [Any , Any ] | Sequence [tuple [Any , Any ]]:
66- if isinstance (idx , slice ):
67- return list (self )[idx ]
68- if idx < 0 :
69- idx = len (self ) + idx
65+ def __getitem__ (self , index : int | slice ) -> tuple [Any , Any ] | Sequence [tuple [Any , Any ]]:
66+ if isinstance (index , slice ):
67+ return list (self )[index ]
68+ if index < 0 :
69+ index = len (self ) + index
7070 for idx2 , item in enumerate (self ):
71- if idx2 == idx :
71+ if idx2 == index :
7272 return item
7373 raise IndexError ("Protocol item list index out of range" )
7474
@@ -99,13 +99,13 @@ def __init__(self, mapping: "Multiaddr") -> None:
9999 def __contains__ (self , value : object ) -> bool :
100100 return collections .abc .Sequence .__contains__ (self , value )
101101
102- def __getitem__ (self , idx : int | slice ) -> Any | Sequence [Any ]:
103- if isinstance (idx , slice ):
104- return list (self )[idx ]
105- if idx < 0 :
106- idx = len (self ) + idx
102+ def __getitem__ (self , index : int | slice ) -> Any | Sequence [Any ]:
103+ if isinstance (index , slice ):
104+ return list (self )[index ]
105+ if index < 0 :
106+ index = len (self ) + index
107107 for idx2 , value in enumerate (self ):
108- if idx2 == idx :
108+ if idx2 == index :
109109 return value
110110 raise IndexError ("Protocol value list index out of range" )
111111
0 commit comments