Skip to content
Merged
Changes from 1 commit
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
Next Next commit
Change examples to be runnable
  • Loading branch information
slateny committed Mar 29, 2022
commit eca7410ab44fb932f7dcc8933c8c611d74044cb6
5 changes: 3 additions & 2 deletions Doc/howto/functional.rst
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ List comprehensions and generator expressions (short form: "listcomps" and
functional programming language Haskell (https://www.haskell.org/). You can strip
all the whitespace from a stream of strings with the following code::

line_list = [' line 1\n', 'line 2 \n', ...]
line_list = [' line 1\n', 'line 2 \n', ' \n', '']

# Generator expression -- returns iterator
stripped_iter = (line.strip() for line in line_list)
Expand Down Expand Up @@ -363,7 +363,8 @@ have the form::
if condition1
for expr2 in sequence2
if condition2
for expr3 in sequence3 ...
for expr3 in sequence3
...
if condition3
for exprN in sequenceN
if conditionN )
Expand Down