MCPcopy Create free account
hub / github.com/libgit2/pygit2 / check_args

Function check_args

pygit2/options.py:97–105  ·  view source on GitHub ↗
(option: Option, arg1: Any, arg2: Any, expected: int)

Source from the content-addressed store, hash-verified

95
96
97def check_args(option: Option, arg1: Any, arg2: Any, expected: int) -> None:
98 if expected == 0 and (arg1 is not NOT_PASSED or arg2 is not NOT_PASSED):
99 raise TypeError(f'option({option}) takes no additional arguments')
100
101 if expected == 1 and (arg1 is NOT_PASSED or arg2 is not NOT_PASSED):
102 raise TypeError(f'option({option}, x) requires 1 additional argument')
103
104 if expected == 2 and (arg1 is NOT_PASSED or arg2 is NOT_PASSED):
105 raise TypeError(f'option({option}, x, y) requires 2 additional arguments')
106
107
108@overload

Callers 1

optionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…