rwskit.collections
Utilities for working with collections.
Functions
|
Tests if the object is iterable. |
|
Checks if the object is a generator. |
|
Recursively try to get the first non-null value in a collection. |
Module Contents
- rwskit.collections_.is_iterable(obj: Any, consider_string_iterable: bool = False) bool[source]
Tests if the object is iterable.
- Parameters:
obj (any) – An object.
consider_string_iterable (bool, default = False) – Whether to consider strings iterable or not.
- Returns:
Trueifobjis iterable.- Return type:
bool
- rwskit.collections_.is_generator(obj: Any) bool[source]
Checks if the object is a generator.
- Parameters:
obj (any) – An object.
- Returns:
Trueif the object is a generator.- Return type:
bool
- rwskit.collections_.get_first_non_null_value(collection: Iterable) Any | None[source]
Recursively try to get the first non-null value in a collection.
This method will recursively traverse the collection until it finds a non-iterable value that is not
None.- Parameters:
collection (Iterable) – The collection to retrieve the value from.
- Returns:
The first non-null value in the series, if one exists, otherwise return
None.- Return type:
Any, optional