Skip to content

Conversation

@mtc-mlx
Copy link
Contributor

@mtc-mlx mtc-mlx commented Nov 10, 2022

For example:

for (key1, val1), (key2, val2) in itertools.pairwise(dict.items()):
    ...

This is really just "kicking the can down the road" so to speak, because it doesn't allow an infinite number of layers of tuples, but it helps somewhat.

@zzzeek
Copy link
Member

zzzeek commented Nov 10, 2022

how many layers does it support?

@mtc-mlx
Copy link
Contributor Author

mtc-mlx commented Nov 10, 2022

Only two layers, like in the example I gave. I see I forgot to run flake on the test folder; oops.

Copy link
Collaborator

@sqla-tester sqla-tester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this is sqla-tester setting up my work on behalf of zzzeek to try to get revision 9f953ac of this pull request into gerrit so we can run tests and reviews and stuff

Copy link
Collaborator

@sqla-tester sqla-tester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this is sqla-tester setting up my work on behalf of zzzeek to try to get revision 9f953ac of this pull request into gerrit so we can run tests and reviews and stuff

@sqla-tester
Copy link
Collaborator

New Gerrit review created for change 9f953ac: https://gerrit.sqlalchemy.org/c/sqlalchemy/mako/+/4187

@zzzeek
Copy link
Member

zzzeek commented Nov 10, 2022

looks like it needs pre-commit run, that will fix up the pep8 problems.

also we need a changelog file in the doc/build/unreleased/ folder. See 9257602 for an example of this.

@mtc-mlx
Copy link
Contributor Author

mtc-mlx commented Nov 10, 2022

Thanks for the guidance :)

@zzzeek zzzeek requested a review from sqla-tester November 10, 2022 15:30
Copy link
Collaborator

@sqla-tester sqla-tester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this is sqla-tester setting up my work on behalf of zzzeek to try to get revision 3f15a87 of this pull request into gerrit so we can run tests and reviews and stuff

@sqla-tester
Copy link
Collaborator

Patchset 3f15a87 added to existing Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/mako/+/4187

@sqla-tester
Copy link
Collaborator

mike bayer (zzzeek) wrote:

thanks!

View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/mako/+/4187

@sqla-tester
Copy link
Collaborator

Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/mako/+/4187 has been merged. Congratulations! :)

artdogma added a commit to artdogma/pymako that referenced this pull request Aug 27, 2025
Fixed issue where unpacking nested tuples in a for loop using would raise a
"couldn't apply loop context" error if the loop context was used. The regex
used to match the for loop expression now allows the list of loop variables
to contain parenthesized sub-tuples. Pull request courtesy Matt Trescott.

For example:
~~~
for (key1, val1), (key2, val2) in itertools.pairwise(dict.items()):
    ...
~~~

This is really just "kicking the can down the road" so to speak, because
it doesn't allow an infinite number of layers of tuples, but
it helps somewhat.

Closes: #368
Pull-request: sqlalchemy/mako#368
Pull-request-sha: 3f15a87266a36306826d460cddc7699dd62a9c43

Change-Id: I52915acb8904daf7071d8c92e1de352f200131ec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants