algebraixlib.undef module¶
Facilities for representing and working with the concept of “undefined”.
Most operations are not defined for all types of data: set operations may not be defined on
couplets, multiset operations may not be defined on sets, and so on. When an
operation is not defined for a given input, it returns the singleton Undef(). This return value
can then be taken into account by the caller. In some cases it is an error, in other cases the
result is simply ignored.
-
class
algebraixlib.undef.Undef[source]¶ Bases:
objectA singleton class that represents the concept of “undefined”.
Instances of this class are not treated as a value by the operations in this library; specifically, it will never appear as the value of an
Atom.Override
__new__to create a singleton class.-
cached_relation¶ Return the cached state of being a relation. See [PropCache].
-
cached_is_relation¶ Return
Falsesinceselfis known not to be a relation. See [PropCache].
-
cached_is_not_relation¶ Return
Truesinceselfis known not to be a relation. See [PropCache].
-
cached_clan¶ Return the cached state of being a clan. See [PropCache].
-
cached_is_clan¶ Return
Falsesinceselfis known not to be a clan. See [PropCache].
-
cached_is_not_clan¶ Return
Truesinceselfis known not to be a clan. See [PropCache].
-
cached_multiclan¶ Return the cached state of being a multiclan. See [PropCache].
-
cached_is_multiclan¶ Return
Falsesinceselfis known to not be a multiclan. See [PropCache].
-
cached_is_not_multiclan¶ Return
Truesinceselfis known not to be a multiclan. See [PropCache].
-
cached_absolute¶ Return the cached state of being absolute. See [PropCache].
-
cached_is_absolute¶ Return
Falsesinceselfis known not to be absolute. See [PropCache].
-
cached_is_not_absolute¶ Return
Truesinceselfis known not to be absolute. See [PropCache].
-
cached_functional¶ Return the cached state of being functional. See [PropCache].
-
cached_is_functional¶ Return
Falsesince functional does not apply. See [PropCache].
-
cached_is_not_functional¶ Return
Falsesince functional does not apply. See [PropCache].
-
cached_right_functional¶ Return the cached state of being right-functional. See [PropCache].
-
cached_is_right_functional¶ Return
Falsesince right-functional does not apply. See [PropCache].
-
cached_is_not_right_functional¶ Return
Falsesince right-functional does not apply. See [PropCache].
-
cached_reflexive¶ Return the cached state of being reflexive. See [PropCache].
-
cached_is_reflexive¶ Return
Falsesince reflexive does not apply. See [PropCache].
-
cached_is_not_reflexive¶ Return
Falsesince reflexive does not apply. See [PropCache].
-
cached_symmetric¶ Return the cached state of being symmetric. See [PropCache].
-
cached_is_symmetric¶ Return
Falsesince symmetric does not apply. See [PropCache].
-
cached_is_not_symmetric¶ Return
Falsesince symmetric does not apply. See [PropCache].
-
cached_transitive¶ Return the cached state of being transitive. See [PropCache].
-
cached_is_transitive¶ Return
Falsesince transitive does not apply. See [PropCache].
-
cached_is_not_transitive¶ Return
Falsesince transitive does not apply. See [PropCache].
-
cached_regular¶ Return the cached state of being regular. See [PropCache].
-
cached_is_regular¶ Return
Falsesince regular does not apply. See [PropCache].
-
cached_is_not_regular¶ Return
Falsesince regular does not apply. See [PropCache].
-
cached_right_regular¶ Return the cached state of being right-regular. See [PropCache].
-
cached_is_right_regular¶ Return
Falsesince right-regular does not apply. See [PropCache].
-
cached_is_not_right_regular¶ Return
Falsesince right-regular does not apply. See [PropCache].
-
__hash__= None¶
-
-
class
algebraixlib.undef.RaiseOnUndef[source]¶ Bases:
objectManage the level for
make_or_raise_undef. Implemented as static class.-
static
get_level()[source]¶ Return the current level for raising an
UndefException.The exception is raised if the
levelargument ofmake_or_raise_undefis less than or equal to the value returned here.
-
static
set_level(temp_value)[source]¶ Set the level for raising an
UndefExceptiontemporarily totemp_value.
-
static
reset()[source]¶ Reset the level for raising an
UndefExceptionback to its initial value.
-
static
-
exception
algebraixlib.undef.UndefException[source]¶ Bases:
ExceptionThis exception is raised when the
levelargument ofmake_or_raise_undefis less than or equal to theRaiseOnUndeflevel.
-
algebraixlib.undef.make_or_raise_undef(level=1)[source]¶ Raise
UndefExceptioniflevelis less than or equal to theRaiseOnUndeflevel, otherwise returnUndef().Parameters: level – An integer >= 1. Default is 1. Note
Use 1 (or no argument) for the cases that are most likely to be errors (like wrong argument types). Use higher numbers for cases that may return
Undef()on purpose.
-
algebraixlib.undef.make_or_raise_undef2(obj)[source]¶ Raise
UndefExceptioniflevelis less than or equal to theRaiseOnUndeflevel, otherwise returnUndef().Parameters: obj – Causes levelargument tomake_or_raise_undefto be 2 ifUndef()