pak.util.interfaces¶
Utilities for checking object interfaces.
- is_iterable(obj)¶
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
- file_object(obj)¶
Converts an object to a file object.
- Parameters:
obj (file object or
bytesorbytearray) – The object to convert.- Returns:
The corresponding file object.
- Return type:
file object