@@ -106,10 +106,7 @@ def type_safe_numbers(*args: Union[Decimal, float, int]) -> Iterable[Union[float
106106 if any (isinstance (arg , float ) for arg in args ) and any (
107107 isinstance (arg , Decimal ) for arg in args
108108 ):
109- # pytype error: bad return type
110- # Expected: Tuple[Union[float, int]]
111- # Actually returned: Iterator[float]
112- return map (float , args ) # pytype: disable=bad-return-type
109+ return map (float , args )
113110 # type error: Incompatible return value type (got "Tuple[Union[Decimal, float, int], ...]", expected "Iterable[Union[float, int]]")
114111 # NOTE on type error: if args contains a Decimal it will nopt get here.
115112 return args # type: ignore[return-value]
@@ -139,10 +136,7 @@ def update(self, row: FrozenBindings, aggregator: "Aggregator") -> None:
139136 pass
140137
141138 def get_value (self ) -> Literal :
142- # pytype error: Invalid keyword argument datatype to function Literal.__init__
143- return Literal (
144- self .value , datatype = self .datatype
145- ) # pytype: disable=wrong-keyword-args
139+ return Literal (self .value , datatype = self .datatype )
146140
147141
148142class Average (Accumulator ):
@@ -203,18 +197,14 @@ def update(self, row: FrozenBindings, aggregator: "Aggregator") -> None:
203197 self .value = _eval (self .expr , row )
204198 else :
205199 # self.compare is implemented by Minimum/Maximum
206- # pytype error: No attribute 'compare' on Extremum
207- self .value = self .compare (
208- self .value , _eval (self .expr , row )
209- ) # pytype: disable=attribute-error
200+ self .value = self .compare (self .value , _eval (self .expr , row ))
210201 # skip UNDEF or BNode => SPARQLTypeError
211202 except NotBoundError :
212203 pass
213204 except SPARQLTypeError :
214205 pass
215206
216207
217- # _ValueT = TypeVar("_ValueT", bound=Union[Variable, BNode, URIRef, Literal])
218208_ValueT = TypeVar ("_ValueT" , Variable , BNode , URIRef , Literal )
219209
220210
@@ -307,8 +297,7 @@ def update(self, row: FrozenBindings) -> None:
307297
308298 for acc in list (self .accumulators .values ()):
309299 if acc .use_row (row ):
310- # pytype error: No attribute 'update' on Accumulator
311- acc .update (row , self ) # pytype: disable=attribute-error
300+ acc .update (row , self )
312301
313302 def get_bindings (self ) -> Mapping [Variable , Identifier ]:
314303 """calculate and set last values"""
0 commit comments