interface

Basic Interface classes.

class tinychain.interface.Compare[source]

Bases: Equality

eq(other)

Returns True if self is equal to other.

gt(other)[source]

Return True if self is greater than other.

gte(other)[source]

Return True if self is greater than or equal to other.

lt(other)[source]

Return True if self is less than other.

lte(other)[source]

Return True if self is less than or equal to other.

ne(other)

Returns True if self is not equal to other.

class tinychain.interface.Equality[source]

Bases: Interface

eq(other)[source]

Returns True if self is equal to other.

ne(other)[source]

Returns True if self is not equal to other.

class tinychain.interface.Functional[source]

Bases: Interface

filter(op)[source]

Filter the elements of this Functional using the given op.

fold(item_name, initial_state, op)[source]

Run the given op for each item in this Functional along with the previous result.

op must be a POST Op. The item to handle will be passed with the given item_name as its name.

for_each(op)[source]

Run the given op for each element in this Functional, then return the last result.

This is useful when you need to execute an op for its side-effects and not its return value.

map(op)[source]

Return a new Functional with the results of op for each element of this Functional.

class tinychain.interface.Interface[source]

Bases: _Base

The base class of a client-defined Interface

class tinychain.interface.Order[source]

Bases: Interface

classmethod max(l, r)[source]

Return l, or r, whichever is greater.

classmethod min(l, r)[source]

Return l, or r, whichever is lesser.