MCPcopy Index your code
hub / github.com/ipython/ipython / is_integer_string

Function is_integer_string

IPython/core/interactiveshell.py:159–168  ·  view source on GitHub ↗

Variant of "str.isnumeric()" that allow negative values and other ints.

(s: str)

Source from the content-addressed store, hash-verified

157
158
159def 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

Callers 3

_find_partsMethod · 0.85
_ofindMethod · 0.85
_getattr_propertyMethod · 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…