cloup._util
¶
Generic utilities.
Classes¶
|
|
A class used just as frozen namespace for constants. |
Functions¶
|
|
|
|
|
|
|
Generate repr(obj). |
|
|
|
|
|
Returns the first value that is not None (or |
|
|
|
|
|
|
|
Attributes¶
Contents¶
-
cloup._util.
click_version_tuple
¶
-
cloup._util.
T
¶
-
cloup._util.
make_repr
(obj, *args, _line_len=60, _indent=2, **kwargs)[source]¶ Generate repr(obj).
- Parameters
obj – object to represent
args – positional arguments in the repr
_line_len (int) – if the repr length exceeds this, arguments will be on their own line; if negative, the repr will be in a single line regardless of its length
_indent (int) – indentation width of arguments in case they are shown in their own line
kwargs – keyword arguments in the repr
- Returns
str
- Return type
-
cloup._util.
coalesce
(*values, default=None)[source]¶ Returns the first value that is not None (or
default
if no such value exists). Inspired by the homonym SQL function.- Parameters
values (Optional[T]) –
- Return type
Optional[T]
-
cloup._util.
listOfNotNone
(iterable)[source]¶ - Parameters
iterable (Iterable[Optional[T]]) –
- Return type
List[T]