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

Function iterencode

Lib/codecs.py:1043–1059  ·  view source on GitHub ↗

Encoding iterator. Encodes the input strings from the iterator using an IncrementalEncoder. errors and kwargs are passed through to the IncrementalEncoder constructor.

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

Source from the content-addressed store, hash-verified

1041 return lookup(encoding).streamwriter
1042
1043def iterencode(iterator, encoding, errors='strict', **kwargs):
1044 """
1045 Encoding iterator.
1046
1047 Encodes the input strings from the iterator using an IncrementalEncoder.
1048
1049 errors and kwargs are passed through to the IncrementalEncoder
1050 constructor.
1051 """
1052 encoder = getincrementalencoder(encoding)(errors, **kwargs)
1053 for input in iterator:
1054 output = encoder.encode(input)
1055 if output:
1056 yield output
1057 output = encoder.encode("", True)
1058 if output:
1059 yield output
1060
1061def iterdecode(iterator, encoding, errors='strict', **kwargs):
1062 """

Callers

nothing calls this directly

Calls 2

getincrementalencoderFunction · 0.85
encodeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…