Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions Doc/library/mimetypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ than one MIME-type database; it provides an interface similar to the one of the
.. class:: MimeTypes(filenames=(), strict=True)

This class represents a MIME-types database. By default, it provides access to
the same database as the rest of this module. The initial database is a copy of
that provided by the module, and may be extended by loading additional
the same database as the rest of this module. The initial database is created from
Python's built-in MIME type tables. It may be extended by loading additional
:file:`mime.types`\ -style files into the database using the :meth:`read` or
:meth:`readfp` methods. The mapping dictionaries may also be cleared before
loading additional data if the default data is not desired.
Expand All @@ -226,30 +226,32 @@ than one MIME-type database; it provides an interface similar to the one of the
Dictionary mapping suffixes to suffixes. This is used to allow recognition of
encoded files for which the encoding and the type are indicated by the same
extension. For example, the :file:`.tgz` extension is mapped to :file:`.tar.gz`
to allow the encoding and type to be recognized separately. This is initially a
copy of the global :data:`suffix_map` defined in the module.
to allow the encoding and type to be recognized separately.
This is initialized with some predefined values.


.. attribute:: MimeTypes.encodings_map

Dictionary mapping filename extensions to encoding types. This is initially a
copy of the global :data:`encodings_map` defined in the module.
Dictionary mapping filename extensions to encoding types.
This is initialized with some predefined values.


.. attribute:: MimeTypes.types_map

Tuple containing two dictionaries, mapping filename extensions to MIME types:
the first dictionary is for the non-standards types and the second one is for
the standard types. They are initialized by :data:`common_types` and
:data:`types_map`.
the standard types.
They are initialized with some predefined values and MIME type
information loaded from files specified by the *filenames* argument.


.. attribute:: MimeTypes.types_map_inv

Tuple containing two dictionaries, mapping MIME types to a list of filename
extensions: the first dictionary is for the non-standards types and the
second one is for the standard types. They are initialized by
:data:`common_types` and :data:`types_map`.
second one is for the standard types.
They are initialized with some predefined values and MIME type
information loaded from files specified by the *filenames* argument.


.. method:: MimeTypes.guess_extension(type, strict=True)
Expand Down
14 changes: 14 additions & 0 deletions Doc/library/pyexpat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,20 @@ XMLParser Objects
or ``None`` if :meth:`SetBase` hasn't been called.


.. method:: xmlparser.GetSpecifiedAttributeCount()

Return the index just past the attributes given in the start tag.
Attributes defaulted from the DTD follow the specified ones,
so attributes at lower indices in the list
passed to :attr:`StartElementHandler` were given in the start tag.
Each attribute takes two items in that list,
its name and its value.
Only meaningful inside a :attr:`StartElementHandler` call,
and only if :attr:`ordered_attributes` is true.

.. versionadded:: next


.. method:: xmlparser.GetInputContext()

Returns the input data that generated the current event as a string. The data is
Expand Down
7 changes: 4 additions & 3 deletions Doc/library/site.rst
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,10 @@ Module contents

Return a list containing all global site-packages directories.

For each directory present in *prefixes* (or :data:`PREFIXES` if *prefixes*
is ``None``), this function will find its site-packages subdirectory
depending on the system environment, and will return a list of full paths.
For each directory given in *prefixes* (or :data:`PREFIXES` if *prefixes*
is ``None``), this function will compute its site-packages subdirectory
depending on the system environment, and will return a list of full paths,
which are not checked for existence.

.. versionadded:: 3.2

Expand Down
42 changes: 34 additions & 8 deletions Doc/library/xml.dom.minidom.rst
Original file line number Diff line number Diff line change
Expand Up @@ -245,21 +245,47 @@ rules apply:
Instead, :mod:`!xml.dom.minidom` uses standard Python exceptions such as
:exc:`TypeError` and :exc:`AttributeError`.

* :class:`NodeList` objects are implemented using Python's built-in list type.
These objects provide the interface defined in the DOM specification, but with
earlier versions of Python they do not support the official API. They are,
however, much more "Pythonic" than the interface defined in the W3C
recommendations.
* Each of the :class:`~xml.dom.NodeList` and :class:`~xml.dom.NamedNodeMap`
interfaces has two implementations, which provide additional methods and
operations.

:attr:`~xml.dom.Node.childNodes` is a subclass of :class:`list`, or, for
nodes which cannot have children, a subclass of :class:`tuple`.
It supports iteration, concatenation, indexing and slicing.

:attr:`~xml.dom.Node.attributes` supports ``len()``, the :keyword:`in`
operator, subscription by a name or by a ``(namespaceURI, localName)``
tuple, assignment and deletion, and the methods :meth:`!get`, :meth:`!keys`,
:meth:`!keysNS`, :meth:`!values`, :meth:`!items` and :meth:`!itemsNS`.
:attr:`~xml.dom.DocumentType.entities` and
:attr:`~xml.dom.DocumentType.notations` are read-only and support only
``len()`` and subscription by a name.

* :attr:`~xml.dom.Document.strictErrorChecking` is always ``False``.

.. versionchanged:: next
Previously, :attr:`~xml.dom.Attr.specified` was always ``False``.

* The constraints of the DOM are now enforced,
and the corresponding exceptions are raised.

.. versionchanged:: next
Previously, many invalid operations silently succeeded
and produced an invalid document,
but removing an absent attribute raised :exc:`~xml.dom.NotFoundErr`.

The following interfaces have no implementation in :mod:`!xml.dom.minidom`:

* :class:`DOMTimeStamp`

* :class:`EntityReference`

Most of these reflect information in the XML document that is not of general
This reflects information in the XML document that is not of general
utility to most DOM users.

.. versionchanged:: next
:class:`~xml.dom.EntityReference` is now implemented.
Note that the parser expands entity references,
so they only occur in a document if created explicitly.

.. rubric:: Footnotes

.. [1] The encoding name included in the XML output should conform to
Expand Down
Loading
Loading