Variant of "str.isnumeric()" that allow negative values and other ints.
(s: str)
| 157 | |
| 158 | |
| 159 | def is_integer_string(s: str): |
| 160 | """ |
| 161 | Variant of "str.isnumeric()" that allow negative values and other ints. |
| 162 | """ |
| 163 | try: |
| 164 | int(s) |
| 165 | return True |
| 166 | except ValueError: |
| 167 | return False |
| 168 | raise ValueError("Unexpected error") |
| 169 | |
| 170 | |
| 171 | @undoc |
no outgoing calls
no test coverage detected
searching dependent graphs…