You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2.0 KiB
2.0 KiB
Skylib module containing functions that operate on collections.
collections.after_each
collections.after_each(separator, iterable)
Inserts separator after each item in iterable.
PARAMETERS
| Name | Description | Default Value |
|---|---|---|
| separator | The value to insert after each item in iterable. |
none |
| iterable | The list into which to intersperse the separator. | none |
RETURNS
A new list with separator after each item in iterable.
collections.before_each
collections.before_each(separator, iterable)
Inserts separator before each item in iterable.
PARAMETERS
| Name | Description | Default Value |
|---|---|---|
| separator | The value to insert before each item in iterable. |
none |
| iterable | The list into which to intersperse the separator. | none |
RETURNS
A new list with separator before each item in iterable.
collections.uniq
collections.uniq(iterable)
Returns a list of unique elements in iterable.
Requires all the elements to be hashable.
PARAMETERS
| Name | Description | Default Value |
|---|---|---|
| iterable | An iterable to filter. | none |
RETURNS
A new list with all unique elements from iterable.