Parse a non-negative integer from a string.
(s: str)
| 858 | |
| 859 | |
| 860 | def parse_int(s: str) -> int: |
| 861 | """Parse a non-negative integer from a string.""" |
| 862 | if DIGITS.fullmatch(s) is None: |
| 863 | raise ValueError("not an integer: %r" % s) |
| 864 | return int(s) |
| 865 | |
| 866 | |
| 867 | def parse_hex_int(s: str) -> int: |
no outgoing calls
no test coverage detected