Skip to content

Converting generator expression to list comprehension in Python #430

Closed Answered by HerringtonDarkholme
q0w asked this question in Q&A
Discussion options

You must be logged in to vote

Looks like it is impossible to do it here...
Python generator is very unique in that parentheses are shared by the generator_expression and call expression.
And it is impossible to make a contextual pattern because ($$$A) is not interpreted as a generator expression.

I think it might need string manipulation to make it work.

Reference: #315

Replies: 2 comments 15 replies

Comment options

You must be logged in to vote
2 replies
Answer selected by q0w
Comment options

You must be logged in to vote
13 replies
@q0w
Comment options

@HerringtonDarkholme
Comment options

@q0w
Comment options

@HerringtonDarkholme
Comment options

@q0w
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants