(option: Option, arg1: Any, arg2: Any, expected: int)
| 95 | |
| 96 | |
| 97 | def 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 |
no outgoing calls
no test coverage detected
searching dependent graphs…