Skip to content

Commit

Permalink
Update black formatting for Python 3.9 (python#18335)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdce8p committed Dec 25, 2024
1 parent ea48bfe commit 43846d5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
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"]
skip-magic-trailing-comma = true
force-exclude = '''
^/mypy/typeshed|
Expand Down

0 comments on commit 43846d5

Please sign in to comment.