module documentation
Generic functions.
Class |
|
A decorator for storing function attributes. |
Class |
|
Undocumented |
Class |
|
A dynamically scoped variable. |
Exception |
|
Raise this for top-level usage errors. |
Function | concat |
Undocumented |
Function | format |
Format a version tuple into a dotted version string. |
Function | invert |
Invert a dictionary. |
Function | list |
Like str.startswith, but for lists. |
Function | list |
Remove prefix, if it's there. |
Function | maybe |
Truncate long strings (and append '...'), but leave short strings alone. |
Function | native |
Convert a bytes object to the native str type. |
Function | numeric |
Undocumented |
Function | pretty |
Pretty-print a conjunction. Use parentheses as necessary. |
Function | pretty |
Pretty-print a disjunctive normal form (disjunction of conjunctions). |
Function | strip |
Strip off prefix if it exists. |
Function | unique |
Return a unique list from an iterable, preserving order. |
Function | validate |
Raise an exception if the python version is unsupported. |
Function | version |
Parse a version string like "3.7" into a tuple. |
Function | _arg |
Return the argument names of a function. |
Function | _validate |
Undocumented |
Constant | _VALIDATE |
Undocumented |
Invert a dictionary. Converts a dictionary (mapping strings to lists of strings) to a dictionary that maps into the other direction. Arguments: d: Dictionary to be inverted Returns: A dictionary n with the property that if "y in d[x]", then "x in n[y]".
Pretty-print a conjunction. Use parentheses as necessary. E.g. ["a", "b"] -> "(a & b)" Args: conjunction: List of strings. Returns: A pretty-printed string.
Pretty-print a disjunctive normal form (disjunction of conjunctions). E.g. [["a", "b"], ["c"]] -> "(a & b) | c". Args: dnf: A list of list of strings. (Disjunction of conjunctions of strings) Returns: A pretty-printed string.