dolor.util.interfaces¶
Utilities for checking object interfaces.
- is_iterable(obj)[source]¶
Checks if an object is iterable.
- Parameters
obj –
The object to check.
objis iterable if it can be used in the following expression:for x in obj: pass
- Returns
Whether
objis iterable.- Return type
bool
- is_container(obj)[source]¶
Checks if an object is a container.
- Parameters
obj –
The object to check.
objis a container if it can be used in the following expression:x in obj
- Returns
Whether
objis a container.- Return type
bool