pyuutils.base.relation

Relation convertion table:

Func

DIFFERENT

SUPERSET

SUBSET

EQUAL

sym_relation

DIFFERENT

SUBSET

SUPERSET

EQUAL

sub2super

DIFFERENT

DIFFERENT

SUPERSET

SUPERSET

super2sub

DIFFERENT

SUBSET

DIFFERENT

SUBSET

Relation

enum pyuutils.base.relation.Relation(value)[source]

Enum for base relations between sets.

Valid values are as follows:

DIFFERENT = <Relation.DIFFERENT: <_CRelation._c_DIFFERENT: 0>>

Incomparable or not (set1 <= set2) depending on exactness

SUPERSET = <Relation.SUPERSET: <_CRelation._c_SUPERSET: 1>>

Same as superset

SUBSET = <Relation.SUBSET: <_CRelation._c_SUBSET: 2>>

Same as subset

EQUAL = <Relation.EQUAL: <_CRelation._c_EQUAL: 3>>

Set1 is equal to set2 or not used

sym_relation

pyuutils.base.relation.sym_relation(rel: Relation) Relation[source]

Return the symmetric of a relation (invert subset and superset bits).

Parameters:

rel – Relation to invert.

Returns:

Inverted relation.

sub2super

pyuutils.base.relation.sub2super(rel: Relation) Relation[source]

Convert a subset relation to a superset relation.

Parameters:

rel – Relation to convert.

Returns:

Converted relation.

super2sub

pyuutils.base.relation.super2sub(rel: Relation) Relation[source]

Convert a superset relation to a subset relation.

Parameters:

rel – Relation to convert.

Returns:

Converted relation.