@@ -106,10 +106,7 @@ def type_safe_numbers(*args: Union[Decimal, float, int]) -> Iterable[Union[float
106
106
if any (isinstance (arg , float ) for arg in args ) and any (
107
107
isinstance (arg , Decimal ) for arg in args
108
108
):
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 )
113
110
# type error: Incompatible return value type (got "Tuple[Union[Decimal, float, int], ...]", expected "Iterable[Union[float, int]]")
114
111
# NOTE on type error: if args contains a Decimal it will nopt get here.
115
112
return args # type: ignore[return-value]
@@ -139,10 +136,7 @@ def update(self, row: FrozenBindings, aggregator: "Aggregator") -> None:
139
136
pass
140
137
141
138
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 )
146
140
147
141
148
142
class Average (Accumulator ):
@@ -203,18 +197,14 @@ def update(self, row: FrozenBindings, aggregator: "Aggregator") -> None:
203
197
self .value = _eval (self .expr , row )
204
198
else :
205
199
# 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 ))
210
201
# skip UNDEF or BNode => SPARQLTypeError
211
202
except NotBoundError :
212
203
pass
213
204
except SPARQLTypeError :
214
205
pass
215
206
216
207
217
- # _ValueT = TypeVar("_ValueT", bound=Union[Variable, BNode, URIRef, Literal])
218
208
_ValueT = TypeVar ("_ValueT" , Variable , BNode , URIRef , Literal )
219
209
220
210
@@ -307,8 +297,7 @@ def update(self, row: FrozenBindings) -> None:
307
297
308
298
for acc in list (self .accumulators .values ()):
309
299
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 )
312
301
313
302
def get_bindings (self ) -> Mapping [Variable , Identifier ]:
314
303
"""calculate and set last values"""
0 commit comments