# on a single list
from fasttrackpy.utils.safely import filter_nones
= [1, 2, None, 6]
a
# value unpacking
= filter_nones(a, [a])
a, print(a)
[1, 2, 6]
utils.safely
Name | Description |
---|---|
filter_nones | Filter lists based on the presence of None values. |
safely | A decorator for more graceful failing. |
utils.safely.filter_nones(filterer, to_filter)
Filter lists based on the presence of None values.
Name | Type | Description | Default |
---|---|---|---|
filterer |
Sequence | The filterer list that may contain None values |
required |
to_filter |
list[Sequence] | A list of lists to filter. | required |
Type | Description |
---|---|
list[Sequence] | list[Sequence]: description |
utils.safely.safely(message=f'There was a problem a function's application.')
A decorator for more graceful failing. If the decorated function raises an exception, it will return None
.
Name | Type | Description | Default |
---|---|---|---|
message |
str | A warning message in the case of an exception. Defaults to f"There was a problem a function's application." . |
f'There was a problem a function's application.' |