rwskit.collections_ =================== .. py:module:: rwskit.collections_ .. autoapi-nested-parse:: Utilities for working with collections. Functions --------- .. autoapisummary:: rwskit.collections_.is_iterable rwskit.collections_.is_generator rwskit.collections_.get_first_non_null_value Module Contents --------------- .. py:function:: is_iterable(obj: Any, consider_string_iterable: bool = False) -> bool Tests if the object is iterable. :param obj: An object. :type obj: any :param consider_string_iterable: Whether to consider strings iterable or not. :type consider_string_iterable: bool, default = False :returns: ``True`` if ``obj`` is iterable. :rtype: bool .. py:function:: is_generator(obj: Any) -> bool Checks if the object is a generator. :param obj: An object. :type obj: any :returns: ``True`` if the object is a generator. :rtype: bool .. py:function:: get_first_non_null_value(collection: Iterable) -> Optional[Any] 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``. :param collection: The collection to retrieve the value from. :type collection: Iterable :returns: The first non-null value in the series, if one exists, otherwise return ``None``. :rtype: Any, optional