Skip to content

Commit 61ebced

Browse files
author
theodoreando
committed
docstring improvements for previously undocumented args
1 parent 6ae4460 commit 61ebced

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

mypy/messages.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2575,9 +2575,10 @@ def format_type_inner(
25752575
Args:
25762576
typ: type to be formatted
25772577
verbosity: a coarse grained control on the verbosity of the type
2578+
options: Options object controlling formatting
25782579
fullnames: a set of names that should be printed in full
2579-
use_pretty_callable: use MessageBuilder.pretty_callable to format Callable
2580-
types.
2580+
module_names: whether to show module names for module types
2581+
use_pretty_callable: use pretty_callable to format Callable types.
25812582
"""
25822583

25832584
def format(typ: Type) -> str:
@@ -2777,11 +2778,11 @@ def format_literal_value(typ: LiteralType) -> str:
27772778

27782779
# Use pretty format (def-style) for complex signatures with named, optional, or star args.
27792780
# Use compact Callable[[...], ...] only for signatures with all simple positional args.
2780-
has_complex_args = any(
2781+
would_use_arg_constructors = any(
27812782
not should_format_arg_as_type(kind, name, verbosity)
27822783
for kind, name in zip(func.arg_kinds, func.arg_names)
27832784
)
2784-
if use_pretty_callable and has_complex_args:
2785+
if use_pretty_callable and would_use_arg_constructors:
27852786
return pretty_callable(func, options)
27862787

27872788
args = format_callable_args(

0 commit comments

Comments
 (0)