Skip to content

Commit 7e16ac4

Browse files
run_build doesn't need to have default arguments
I guess reasonable minds could disagree on this
1 parent ad9b9c1 commit 7e16ac4

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

mypy/main.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def main(
7777
# As a common pattern around the codebase, we tend to do this instead of
7878
# using default arguments that are mutable objects (due to Python's
7979
# famously counterintuitive behavior about those): use a sentinel, then
80-
# set.
80+
# set. If there is no `= None` after the type, we don't manipulate it thus.
8181
stdout = stdout if stdout is not None else sys.stdout
8282
stderr = stderr if stderr is not None else sys.stderr
8383
# sys.stdout and sys.stderr might technically be None, but this fact isn't
@@ -192,14 +192,12 @@ def run_build(
192192
options: Options,
193193
fscache: FileSystemCache,
194194
t0: float,
195-
stdout: TextIO | None = None,
196-
stderr: TextIO | None = None,
195+
stdout: TextIO | None,
196+
stderr: TextIO | None,
197197
) -> tuple[build.BuildResult | None, list[str], bool]:
198198
formatter = util.FancyFormatter(
199199
stdout, stderr, options.hide_error_codes, hide_success=bool(options.output)
200200
)
201-
stdout = stdout if stdout is not None else sys.stdout
202-
stderr = stderr if stderr is not None else sys.stderr
203201
messages = []
204202
messages_by_file = defaultdict(list)
205203

0 commit comments

Comments
 (0)