Lines Matching defs:operator

16 import operator
251 '+': operator.add,
252 '-': operator.sub,
253 '*': operator.mul,
254 '/': operator.truediv,
255 '//': operator.floordiv,
256 '**': operator.pow,
257 '%': operator.mod
264 '+': operator.pos,
265 '-': operator.neg
268 #: a set of binary operators that should be intercepted. Each operator
270 #: :meth:`call_binop` method that will perform the operator. The default
271 #: operator callback is specified by :attr:`binop_table`.
276 #: The default operation form the operator table corresponds to the
278 #: operator call, so make sure only to intercept the ones you are
284 #: a set of unary operators that should be intercepted. Each operator
286 #: :meth:`call_unop` method that will perform the operator. The default
287 #: operator callback is specified by :attr:`unop_table`.
291 #: The default operation form the operator table corresponds to the
293 #: operator call, so make sure only to intercept the ones you are
299 def intercept_unop(self, operator):
301 operator to check if it should be intercepted at runtime. If this
303 operator. The default implementation of :meth:`call_unop` will use
304 the :attr:`unop_table` dictionary to perform the operator with the
309 Intercepted calls are always slower than the native operator call,
341 def call_binop(self, context, operator, left, right):
342 """For intercepted binary operator calls (:meth:`intercepted_binops`)
343 this function is executed instead of the builtin operator. This can
348 return self.binop_table[operator](left, right)
350 def call_unop(self, context, operator, arg):
351 """For intercepted unary operator calls (:meth:`intercepted_unops`)
352 this function is executed instead of the builtin operator. This can
357 return self.unop_table[operator](arg)