collections_utils
cut_iterable_to(obj, to)
Cut an iterable to a certain length.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obj
|
Iterable
|
The iterable to cut. |
required |
to
|
int
|
The number of elements to return. |
required |
Returns:
| Type | Description |
|---|---|
Union[List, Mapping]
|
A list or dictionary (depending on the type of object) of elements and |
int
|
the remaining elements in the original list or dictionary. |