MCPcopy Index your code
hub / github.com/python/cpython / check_remaining_star

Method check_remaining_star

Tools/clinic/libclinic/dsl_parser.py:1590–1614  ·  view source on GitHub ↗
(self, lineno: int | None = None)

Source from the content-addressed store, hash-verified

1588 parameters=parameters).rstrip()
1589
1590 def check_remaining_star(self, lineno: int | None = None) -> None:
1591 assert isinstance(self.function, Function)
1592
1593 if self.keyword_only:
1594 symbol = '*'
1595 elif self.deprecated_positional:
1596 symbol = '* [from ...]'
1597 else:
1598 return
1599
1600 for p in reversed(self.function.parameters.values()):
1601 if self.keyword_only:
1602 if p.kind in {
1603 inspect.Parameter.KEYWORD_ONLY,
1604 inspect.Parameter.VAR_POSITIONAL,
1605 inspect.Parameter.VAR_KEYWORD
1606 }:
1607 return
1608 elif self.deprecated_positional:
1609 if p.deprecated_positional == self.deprecated_positional:
1610 return
1611 break
1612
1613 fail(f"Function {self.function.name!r} specifies {symbol!r} "
1614 f"without following parameters.", line_number=lineno)
1615
1616 def check_previous_star(self) -> None:
1617 assert isinstance(self.function, Function)

Callers 3

parse_parameterMethod · 0.95
parse_starMethod · 0.95

Calls 2

failFunction · 0.90
valuesMethod · 0.45

Tested by

no test coverage detected