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

Function _encode_int

simplejson/encoder.py:479–495  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

477 return None
478
479 def _encode_int(value):
480 skip_quoting = (
481 _int_as_string_bitcount is None
482 or
483 _int_as_string_bitcount < 1
484 )
485 if type(value) not in integer_types:
486 # See #118, do not trust custom str/repr
487 value = int(value)
488 if (
489 skip_quoting or
490 (-1 << _int_as_string_bitcount)
491 < value <
492 (1 << _int_as_string_bitcount)
493 ):
494 return str(value)
495 return '"' + str(value) + '"'
496
497 def _iterencode_list(lst, _current_indent_level):
498 if not lst:

Callers 3

_iterencode_listFunction · 0.85
_iterencode_dictFunction · 0.85
_iterencodeFunction · 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…