Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update black formatting for Python 3.9 #18335

Merged
merged 1 commit into from
Dec 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions mypy/checkexpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -5345,9 +5345,10 @@ def visit_lambda_expr(self, e: LambdaExpr) -> Type:
self.chk.return_types.append(AnyType(TypeOfAny.special_form))
# Type check everything in the body except for the final return
# statement (it can contain tuple unpacking before return).
with self.chk.binder.frame_context(
can_skip=True, fall_through=0
), self.chk.scope.push_function(e):
with (
self.chk.binder.frame_context(can_skip=True, fall_through=0),
self.chk.scope.push_function(e),
):
# Lambdas can have more than one element in body,
# when we add "fictional" AssignmentStatement nodes, like in:
# `lambda (a, b): a`
Expand Down
7 changes: 4 additions & 3 deletions mypyc/test/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,10 @@ class TestRun(MypycDataSuite):
def run_case(self, testcase: DataDrivenTestCase) -> None:
# setup.py wants to be run from the root directory of the package, which we accommodate
# by chdiring into tmp/
with use_custom_builtins(
os.path.join(self.data_prefix, ICODE_GEN_BUILTINS), testcase
), chdir_manager("tmp"):
with (
use_custom_builtins(os.path.join(self.data_prefix, ICODE_GEN_BUILTINS), testcase),
chdir_manager("tmp"),
):
self.run_case_inner(testcase)

def run_case_inner(self, testcase: DataDrivenTestCase) -> None:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ mypy = [

[tool.black]
line-length = 99
target-version = ["py38", "py39", "py310", "py311", "py312"]
target-version = ["py39", "py310", "py311", "py312", "py313"]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Explicitly keep this setting to allow for easier updates when dropping a python version. Without it, the formatting change would need to happen in the same PR.

skip-magic-trailing-comma = true
force-exclude = '''
^/mypy/typeshed|
Expand Down
Loading