sqlalchemy / mako

Mako Templates for Python
https://www.makotemplates.org
MIT License
353 stars 60 forks source link

Support nested tuple unpacking in for loops #368

Closed mtc-mlx closed 1 year ago

mtc-mlx commented 1 year ago

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 commented 1 year ago

how many layers does it support?

mtc-mlx commented 1 year ago

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

sqla-tester commented 1 year ago

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

zzzeek commented 1 year ago

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 925760291d6efec64fda6e9dd1f for an example of this.

mtc-mlx commented 1 year ago

Thanks for the guidance :)

sqla-tester commented 1 year ago

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

sqla-tester commented 1 year ago

mike bayer (zzzeek) wrote:

thanks!

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

sqla-tester commented 1 year ago

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