codecs.iterencode()

codecs.iterencode(iterator, encoding, errors='strict', **kwargs) Uses an incremental encoder to iteratively encode the input provided by iterator. This function is a generator. The errors argument (as well as any other keyword argument) is passed through to the incremental encoder.

codecs.iterdecode()

codecs.iterdecode(iterator, encoding, errors='strict', **kwargs) Uses an incremental decoder to iteratively decode the input provided by iterator. This function is a generator. The errors argument (as well as any other keyword argument) is passed through to the incremental decoder.

codecs.IncrementalEncoder.setstate()

IncrementalEncoder.setstate(state) Set the state of the encoder to state. state must be an encoder state returned by getstate().

codecs.IncrementalEncoder.reset()

reset() Reset the encoder to the initial state. The output is discarded: call .encode(object, final=True), passing an empty byte or text string if necessary, to reset the encoder and to get the output.

codecs.IncrementalEncoder.getstate()

IncrementalEncoder.getstate() Return the current state of the encoder which must be an integer. The implementation should make sure that 0 is the most common state. (States that are more complicated than integers can be converted into an integer by marshaling/pickling the state and encoding the bytes of the resulting string into an integer).

codecs.IncrementalEncoder.encode()

encode(object[, final]) Encodes object (taking the current state of the encoder into account) and returns the resulting encoded object. If this is the last call to encode() final must be true (the default is false).

codecs.IncrementalEncoder

class codecs.IncrementalEncoder(errors='strict') Constructor for an IncrementalEncoder instance. All incremental encoders must provide this constructor interface. They are free to add additional keyword arguments, but only the ones defined here are used by the Python codec registry. The IncrementalEncoder may implement different error handling schemes by providing the errors keyword argument. See Error Handlers for possible values. The errors argument will be assigned to an attribute of the

codecs.IncrementalDecoder.setstate()

setstate(state) Set the state of the encoder to state. state must be a decoder state returned by getstate().

codecs.IncrementalDecoder.reset()

reset() Reset the decoder to the initial state.

codecs.IncrementalDecoder.getstate()

getstate() Return the current state of the decoder. This must be a tuple with two items, the first must be the buffer containing the still undecoded input. The second must be an integer and can be additional state info. (The implementation should make sure that 0 is the most common additional state info.) If this additional state info is 0 it must be possible to set the decoder to the state which has no input buffered and 0 as the additional state info, so that feeding the previously buffere