From 66dde9d61a0dc8404abcb6fe79a704cb12f1633f Mon Sep 17 00:00:00 2001 From: Blandes22 <96037855+Blandes22@users.noreply.github.com> Date: Fri, 16 Sep 2022 21:00:40 -0500 Subject: [PATCH 1/2] Update future_style.md Noticed a mistake in line 18, all calls to make_context_manager() had the number outside of parentheses. changed "make_context_manager1()" to "make_context_manager(1) ," for all four calls. --- docs/the_black_code_style/future_style.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/the_black_code_style/future_style.md b/docs/the_black_code_style/future_style.md index a17d9a10673..9dad6aa7d65 100644 --- a/docs/the_black_code_style/future_style.md +++ b/docs/the_black_code_style/future_style.md @@ -15,7 +15,7 @@ managers. We don't want formatting like: ```py3 -with make_context_manager1() as cm1, make_context_manager2() as cm2, make_context_manager3() as cm3, make_context_manager4() as cm4: +with make_context_manager(1) as cm1, make_context_manager(2) as cm2, make_context_manager(3) as cm3, make_context_manager(4) as cm4: ... # nothing to split on - line too long ``` From ffd1b873d2dc9a306691a6311f2e805464650315 Mon Sep 17 00:00:00 2001 From: Blandes22 <96037855+Blandes22@users.noreply.github.com> Date: Sun, 18 Sep 2022 10:48:34 -0500 Subject: [PATCH 2/2] Update future_style.md --- docs/the_black_code_style/future_style.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/the_black_code_style/future_style.md b/docs/the_black_code_style/future_style.md index 9dad6aa7d65..a028a2888ed 100644 --- a/docs/the_black_code_style/future_style.md +++ b/docs/the_black_code_style/future_style.md @@ -15,7 +15,7 @@ managers. We don't want formatting like: ```py3 -with make_context_manager(1) as cm1, make_context_manager(2) as cm2, make_context_manager(3) as cm3, make_context_manager(4) as cm4: +with make_context_manager1() as cm1, make_context_manager2() as cm2, make_context_manager3() as cm3, make_context_manager4() as cm4: ... # nothing to split on - line too long ``` @@ -23,10 +23,10 @@ So _Black_ will eventually format it like this: ```py3 with \ - make_context_manager(1) as cm1, \ - make_context_manager(2) as cm2, \ - make_context_manager(3) as cm3, \ - make_context_manager(4) as cm4 \ + make_context_manager1() as cm1, \ + make_context_manager2() as cm2, \ + make_context_manager3() as cm3, \ + make_context_manager4() as cm4 \ : ... # backslashes and an ugly stranded colon ``` @@ -40,10 +40,10 @@ following way: ```python with contextlib.ExitStack() as exit_stack: - cm1 = exit_stack.enter_context(make_context_manager(1)) - cm2 = exit_stack.enter_context(make_context_manager(2)) - cm3 = exit_stack.enter_context(make_context_manager(3)) - cm4 = exit_stack.enter_context(make_context_manager(4)) + cm1 = exit_stack.enter_context(make_context_manager1()) + cm2 = exit_stack.enter_context(make_context_manager2()) + cm3 = exit_stack.enter_context(make_context_manager3()) + cm4 = exit_stack.enter_context(make_context_manager4()) ... ```