MCPcopy Create free account
hub / github.com/simplejson/simplejson / bounded_int

Function bounded_int

simplejson/decoder.py:46–53  ·  view source on GitHub ↗

Backport of the integer string length conversion limitation https://docs.python.org/3/library/stdtypes.html#int-max-str-digits

(s, INT_MAX_STR_DIGITS=4300)

Source from the content-addressed store, hash-verified

44 bounded_int = int
45else:
46 def bounded_int(s, INT_MAX_STR_DIGITS=4300):
47 """Backport of the integer string length conversion limitation
48
49 https://docs.python.org/3/library/stdtypes.html#int-max-str-digits
50 """
51 if len(s) > INT_MAX_STR_DIGITS:
52 raise ValueError("Exceeds the limit (%s) for integer string conversion: value has %s digits" % (INT_MAX_STR_DIGITS, len(s)))
53 return int(s)
54
55
56def scan_four_digit_hex(s, end, _m=re.compile(r'^[0-9a-fA-F]{4}$').match):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…