MCPcopy Create free account
hub / github.com/pytest-dev/pytest / get_default_arg_names

Function get_default_arg_names

src/_pytest/compat.py:200–209  ·  view source on GitHub ↗
(function: Callable[..., Any])

Source from the content-addressed store, hash-verified

198
199
200def get_default_arg_names(function: Callable[..., Any]) -> Tuple[str, ...]:
201 # Note: this code intentionally mirrors the code at the beginning of
202 # getfuncargnames, to get the arguments which were excluded from its result
203 # because they had default values.
204 return tuple(
205 p.name
206 for p in signature(function).parameters.values()
207 if p.kind in (Parameter.POSITIONAL_OR_KEYWORD, Parameter.KEYWORD_ONLY)
208 and p.default is not Parameter.empty
209 )
210
211
212_non_printable_ascii_translate_table = {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected