Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix in flatten_list for Python 3.12 #370

Merged
merged 1 commit into from
Sep 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pingouin/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,6 @@ def _flatten_list(x, include_tuple=False):
# If x is not iterable, return x
if not isinstance(x, collections.abc.Iterable):
return x
# Remove None
x = list(filter(None.__ne__, x))
# Initialize empty output variable
result = []
# Loop over items in x
Expand All @@ -315,6 +313,8 @@ def _flatten_list(x, include_tuple=False):
result.append(el)
else:
result.append(el)
# Remove None from output
result = [r for r in result if r is not None]
return result


Expand Down
Loading