From: Ɓukasz Langa Date: Tue, 5 Jun 2018 01:42:16 +0000 (-0700) Subject: Consider stars in testlist_star_expr unpacking (because they are) X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/bbc09a4f013f2a584f143f3f5e3f76f6082367d4 Consider stars in testlist_star_expr unpacking (because they are) Fixes #297 --- diff --git a/black.py b/black.py index 2783a10..46c0907 100644 --- a/black.py +++ b/black.py @@ -768,6 +768,7 @@ UNPACKING_PARENTS = { syms.dictsetmaker, syms.listmaker, syms.testlist_gexp, + syms.testlist_star_expr, } TEST_DESCENDANTS = { syms.test, diff --git a/tests/expression.diff b/tests/expression.diff index 2632349..0d2ff68 100644 --- a/tests/expression.diff +++ b/tests/expression.diff @@ -147,7 +147,7 @@ slice[0:1:2] slice[:] slice[:-1] -@@ -133,107 +156,159 @@ +@@ -133,108 +156,160 @@ numpy[-(c + 1) :, d] numpy[:, l[-2]] numpy[:, ::-1] @@ -183,6 +183,7 @@ c = 1 d = (1,) + a + (2,) e = (1,).count(1) + f = 1, *range(10) -what_is_up_with_those_new_coord_names = (coord_names + set(vars_to_create)) + set(vars_to_remove) -what_is_up_with_those_new_coord_names = (coord_names | set(vars_to_create)) - set(vars_to_remove) -result = session.query(models.Customer.id).filter(models.Customer.account_id == account_id, models.Customer.email == email_address).order_by(models.Customer.id.asc(),).all() diff --git a/tests/expression.py b/tests/expression.py index f35a6fd..ea927a5 100644 --- a/tests/expression.py +++ b/tests/expression.py @@ -152,6 +152,7 @@ b = 1, c = 1 d = (1,) + a + (2,) e = (1,).count(1) +f = 1, *range(10) what_is_up_with_those_new_coord_names = (coord_names + set(vars_to_create)) + set(vars_to_remove) what_is_up_with_those_new_coord_names = (coord_names | set(vars_to_create)) - set(vars_to_remove) result = session.query(models.Customer.id).filter(models.Customer.account_id == account_id, models.Customer.email == email_address).order_by(models.Customer.id.asc(),).all() @@ -426,6 +427,7 @@ b = (1,) c = 1 d = (1,) + a + (2,) e = (1,).count(1) +f = 1, *range(10) what_is_up_with_those_new_coord_names = (coord_names + set(vars_to_create)) + set( vars_to_remove )