Skip to content

Permit list comprehension–like filtering of for loops. #29

@amcgregor

Description

@amcgregor

Where currently you require multiple lines with explicit flow control statements:

: for item in items
	: if item % 2 == 0
		: continue
	: end

Permit inclusion of filtering conditions (one or more) in the form:

: for item in items if item % 2

There are several avenues for translation to plain Python for these. Unwrap and reconstruct the multiple-line form, or alternatively wrap in a generator comprehension:

for item in (i for i in items if item % 2):

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions