MCPcopy Index your code
hub / github.com/python/cpython / iterdecode

Function iterdecode

Lib/codecs.py:1061–1077  ·  view source on GitHub ↗

Decoding iterator. Decodes the input strings from the iterator using an IncrementalDecoder. errors and kwargs are passed through to the IncrementalDecoder constructor.

(iterator, encoding, errors='strict', **kwargs)

Source from the content-addressed store, hash-verified

1059 yield output
1060
1061def iterdecode(iterator, encoding, errors='strict', **kwargs):
1062 """
1063 Decoding iterator.
1064
1065 Decodes the input strings from the iterator using an IncrementalDecoder.
1066
1067 errors and kwargs are passed through to the IncrementalDecoder
1068 constructor.
1069 """
1070 decoder = getincrementaldecoder(encoding)(errors, **kwargs)
1071 for input in iterator:
1072 output = decoder.decode(input)
1073 if output:
1074 yield output
1075 output = decoder.decode(b"", True)
1076 if output:
1077 yield output
1078
1079### Helpers for charmap-based codecs
1080

Callers

nothing calls this directly

Calls 2

getincrementaldecoderFunction · 0.85
decodeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…