Skip to content

Commit fbb2c46

Browse files
committed
Reword the docstrings
1 parent ad2a2b9 commit fbb2c46

File tree

1 file changed

+6
-18
lines changed

1 file changed

+6
-18
lines changed

mypy/expandtype.py

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -298,17 +298,10 @@ def _possible_callable_varargs(
298298
) -> ProperType:
299299
"""Given a callable, extract all parameters that can be passed as `*args`.
300300
301-
This builds a union of all (possibly variadic) tuples of the shape
302-
[*all_required, *optional_suffix]
303-
where all_required contains args that must be passed positionally,
304-
all_optional contains args that may be omitted, and
305-
optional_suffix is some prefix of all_optional.
306-
307-
This will grab the following argtypes of the function:
308-
309-
* posonly - required unless has a default
310-
* pos-or-kw - always optional as it may be passed by name
311-
* vararg - converted to an Unpack suffix
301+
This builds a union of all (possibly variadic) tuples representing all possible
302+
argument sequences that can be passed positionally. Each such tuple starts with
303+
all required (pos-only without a default) arguments, followed by some prefix
304+
of other arguments that can be passed positionally.
312305
"""
313306
required_posargs = required_prefix
314307
optional_posargs: list[Type] = []
@@ -340,13 +333,8 @@ def _possible_callable_kwargs(cls, repl: Parameters, dict_type: Instance) -> Pro
340333
341334
If the function only accepts **kwargs, this will be a `dict[str, KwargsValueType]`.
342335
Otherwise, this will be a `TypedDict` containing all explicit args and ignoring
343-
`**kwargs` (until PEP 728 `extra_items` is supported).
344-
345-
This will grab the following argtypes of the function:
346-
347-
* kwonly - required unless has a default
348-
* pos-or-kw - always optional as it may be passed positionally
349-
* `**kwargs`
336+
`**kwargs` (until PEP 728 `extra_items` is supported). TypedDict entries will
337+
be required iff the corresponding argument is kw-only and has no default.
350338
"""
351339
kwargs = {}
352340
required_names = set()

0 commit comments

Comments
 (0)