MCPcopy Index your code
hub / github.com/pyload/pyload / _iterencode

Function _iterencode

module/lib/simplejson/encoder.py:494–532  ·  view source on GitHub ↗
(o, _current_indent_level)

Source from the content-addressed store, hash-verified

492 del markers[markerid]
493
494 def _iterencode(o, _current_indent_level):
495 if isinstance(o, basestring):
496 yield _encoder(o)
497 elif o is None:
498 yield 'null'
499 elif o is True:
500 yield 'true'
501 elif o is False:
502 yield 'false'
503 elif isinstance(o, (int, long)):
504 yield str(o)
505 elif isinstance(o, float):
506 yield _floatstr(o)
507 elif isinstance(o, list):
508 for chunk in _iterencode_list(o, _current_indent_level):
509 yield chunk
510 elif (_namedtuple_as_object and isinstance(o, tuple) and
511 hasattr(o, '_asdict')):
512 for chunk in _iterencode_dict(o._asdict(), _current_indent_level):
513 yield chunk
514 elif (_tuple_as_array and isinstance(o, tuple)):
515 for chunk in _iterencode_list(o, _current_indent_level):
516 yield chunk
517 elif isinstance(o, dict):
518 for chunk in _iterencode_dict(o, _current_indent_level):
519 yield chunk
520 elif _use_decimal and isinstance(o, Decimal):
521 yield str(o)
522 else:
523 if markers is not None:
524 markerid = id(o)
525 if markerid in markers:
526 raise ValueError("Circular reference detected")
527 markers[markerid] = o
528 o = _default(o)
529 for chunk in _iterencode(o, _current_indent_level):
530 yield chunk
531 if markers is not None:
532 del markers[markerid]
533
534 return _iterencode

Callers 3

iterencodeMethod · 0.85
encoder.pyFile · 0.85
_iterencode_dictFunction · 0.85

Calls 1

_iterencode_dictFunction · 0.85

Tested by

no test coverage detected