cloup._util
¶
Generic utilities.
Classes¶
|
|
A class used just as frozen namespace for constants. |
Functions¶
|
|
|
|
|
|
|
Generate repr(obj). |
|
|
|
|
|
Return the first value that is not |
|
Return the first bool (or raises |
|
|
|
|
|
|
|
|
|
Attributes¶
Contents¶
-
cloup._util.
click_version_tuple
¶
-
cloup._util.
click_major
¶
-
cloup._util.
click_minor
¶
-
cloup._util.
click_version_ge_8_1
¶
-
cloup._util.
T
¶
-
cloup._util.
K
¶
-
cloup._util.
V
¶
-
cloup._util.
pick_non_missing
(d)[source]¶ - Parameters
d (Dict[K, Union[cloup.typing._Missing, V]]) –
- Return type
Dict[K, V]
-
cloup._util.
make_repr
(obj, *args, _line_len=60, _indent=2, **kwargs)[source]¶ Generate repr(obj).
- Parameters
obj (Any) – object to represent
args (Any) – 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 (Any) – keyword arguments in the repr
- Returns
str
- Return type
-
cloup._util.
coalesce
(*values)[source]¶ Return the first value that is not
None
(orNone
if no such value exists).- Parameters
values (Optional[T]) –
- Return type
Optional[T]
-
cloup._util.
first_bool
(*values)[source]¶ Return the first bool (or raises
StopIteration
if no bool is found).- Parameters
values (Any) –
- Return type
-
cloup._util.
pick_not_none
(iterable)[source]¶ - Parameters
iterable (Iterable[Optional[T]]) –
- Return type
List[T]
-
class
cloup._util.
FrozenSpaceMeta
(cls, *args)[source]¶ Bases:
type
- Parameters
args (Any) –
-
class
cloup._util.
FrozenSpace
[source]¶ A class used just as frozen namespace for constants.
- Return type