Description

Booleans

Subtypable/subtyped Boolean like classes

  • Like Python’s builtin bool, SBool and its subclasses are threadsafe singletons.

  • While still compatible with Python shortcut logic, these can be non-shortcut logically composed with Python’s bitwise operators.

Boolean type hierarchy

digraph Booleans {
    bgcolor="#957fb8";
    node [style=filled, fillcolor="#181616", fontcolor="#dcd7ba"];
    edge [color="#181616", fontcolor="#dcd7ba"];
    int -> bool;
    int -> SBool;
    SBool -> "FBool[H1]";
    SBool -> "FBool[H2]";
    SBool -> "FBool[H3]";
    SBool -> TF_Bool;
    TF_Bool -> T_Bool;
    TF_Bool -> F_Bool;
}