We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The code has missed ignore_types arg when calling the method of flatten recursively in the example about how to flatten a nested sequence.
flatten
src/4/how_to_flatten_a_nested_sequence/example.py
from collections import Iterable def flatten(items, ignore_types=(str, bytes)): for x in items: if isinstance(x, Iterable) and not isinstance(x, ignore_types): yield from flatten(x) else: yield x
The corrected code is yield from flatten(x, ignore_types).
yield from flatten(x, ignore_types)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The code has missed ignore_types arg when calling the method of
flatten
recursively in the example about how to flatten a nested sequence.src/4/how_to_flatten_a_nested_sequence/example.py
The corrected code is
yield from flatten(x, ignore_types)
.The text was updated successfully, but these errors were encountered: