Update signature style of optional arguments, part two.

This commit is contained in:
Georg Brandl 2009-04-05 22:20:44 +00:00
parent 889b0aa450
commit 0d8f07305d
12 changed files with 83 additions and 102 deletions

View file

@ -1,4 +1,3 @@
:mod:`codecs` --- Codec registry and base classes
=================================================
@ -226,34 +225,36 @@ utility functions:
defaults to line buffered.
.. function:: EncodedFile(file, input[, output[, errors]])
.. function:: EncodedFile(file, data_encoding, file_encoding=None, errors='strict')
Return a wrapped version of file which provides transparent encoding
translation.
Bytes written to the wrapped file are interpreted according to the given
*input* encoding and then written to the original file as bytes using the
*output* encoding.
*data_encoding* and then written to the original file as bytes using the
*file_encoding*.
If *output* is not given, it defaults to *input*.
If *file_encoding* is not given, it defaults to *data_encoding*.
*errors* may be given to define the error handling. It defaults to ``'strict'``,
which causes :exc:`ValueError` to be raised in case an encoding error occurs.
*errors* may be given to define the error handling. It defaults to
``'strict'``, which causes :exc:`ValueError` to be raised in case an encoding
error occurs.
.. function:: iterencode(iterable, encoding[, errors])
.. function:: iterencode(iterator, encoding, errors='strict', **kwargs)
Uses an incremental encoder to iteratively encode the input provided by
*iterable*. This function is a :term:`generator`. *errors* (as well as any
*iterator*. This function is a :term:`generator`. *errors* (as well as any
other keyword argument) is passed through to the incremental encoder.
.. function:: iterdecode(iterable, encoding[, errors])
.. function:: iterdecode(iterator, encoding, errors='strict', **kwargs)
Uses an incremental decoder to iteratively decode the input provided by
*iterable*. This function is a :term:`generator`. *errors* (as well as any
*iterator*. This function is a :term:`generator`. *errors* (as well as any
other keyword argument) is passed through to the incremental decoder.
The module also provides the following constants which are useful for reading
and writing to platform dependent files: