Skip to content

qttools.kernels#

source package qttools.kernels

Modules

source module operator

Classes

  • attrgetter Return a callable object that fetches the given attribute(s) from its operand. After f = attrgetter('name'), the call f(r) returns r.name. After g = attrgetter('name', 'date'), the call g(r) returns (r.name, r.date). After h = attrgetter('name.first', 'name.last'), the call h(r) returns (r.name.first, r.name.last).

  • itemgetter Return a callable object that fetches the given item(s) from its operand. After f = itemgetter(2), the call f(r) returns r[2]. After g = itemgetter(2, 5, 3), the call g(r) returns (r[2], r[5], r[3])

  • methodcaller Return a callable object that calls the given method on its operand. After f = methodcaller('name'), the call f(r) returns r.name(). After g = methodcaller('name', 'date', foo=1), the call g(r) returns r.name('date', foo=1).

Functions

  • abs Same as abs(a).

  • add Same as a + b.

  • and_ Same as a & b.

  • call Same as obj(args, *kwargs).

  • concat Same as a + b, for a and b sequences.

  • contains Same as b in a (note reversed operands).

  • countOf Return the number of items in a which are, or which equal, b.

  • delitem Same as del a[b].

  • eq Same as a == b.

  • floordiv Same as a // b.

  • ge Same as a >= b.

  • getitem Same as a[b].

  • gt Same as a > b.

  • iadd Same as a += b.

  • iand Same as a &= b.

  • iconcat Same as a += b, for a and b sequences.

  • ifloordiv Same as a //= b.

  • ilshift Same as a <<= b.

  • imatmul Same as a @= b.

  • imod Same as a %= b.

  • imul Same as a *= b.

  • index Same as a.index().

  • indexOf Return the first index of b in a.

  • inv Same as ~a.

  • ior Same as a |= b.

  • ipow Same as a **= b.

  • irshift Same as a >>= b.

  • is_ Same as a is b.

  • is_not Same as a is not b.

  • isub Same as a -= b.

  • itruediv Same as a /= b.

  • ixor Same as a ^= b.

  • le Same as a <= b.

  • length_hint Return an estimate of the number of items in obj. This is useful for presizing containers when building from an iterable.

  • lshift Same as a << b.

  • lt Same as a < b.

  • matmul Same as a @ b.

  • mod Same as a % b.

  • mul Same as a * b.

  • ne Same as a != b.

  • neg Same as -a.

  • not_ Same as not a.

  • or_ Same as a | b.

  • pos Same as +a.

  • pow Same as a ** b.

  • rshift Same as a >> b.

  • setitem Same as a[b] = c.

  • sub Same as a - b.

  • truediv Same as a / b.

  • truth Return True if a is true, False otherwise.

  • xor Same as a ^ b.