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

    Encodes the input strings from the iterator using a IncrementalEncoder.

    errors and kwargs are passed through to the IncrementalEncoder
    constructor.
Encoding iterator.
Encoding iterator .
def iterencode(iterator, encoding, errors='strict', **kwargs):
    """
    Encoding iterator.

    Encodes the input strings from the iterator using a IncrementalEncoder.

    errors and kwargs are passed through to the IncrementalEncoder
    constructor.
    """
    encoder = getincrementalencoder(encoding)(errors, **kwargs)
    for input in iterator:
        output = encoder.encode(input)
        if output:
            yield output
    output = encoder.encode("", True)
    if output:
        yield output
def iterencode ( iterator , encoding , errors = 'strict' , * * kwargs ) : encoder = getincrementalencoder ( encoding ) ( errors , * * kwargs ) for input in iterator : output = encoder . encode ( input ) if output : yield output output = encoder . encode ( "" , True ) if output : yield output