MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / iterencode

Function iterencode

tools/python-3.11.9-amd64/Lib/codecs.py:1038–1054  ·  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

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

Callers

nothing calls this directly

Calls 2

getincrementalencoderFunction · 0.85
encodeMethod · 0.45

Tested by

no test coverage detected