Skip to content

Commit 6bc4773

Browse files
Deploy preview for PR 1231 🛫
1 parent b9e3dcf commit 6bc4773

590 files changed

Lines changed: 2324 additions & 930 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

pr-preview/pr-1231/_sources/library/mimetypes.rst.txt

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ than one MIME-type database; it provides an interface similar to the one of the
203203
.. class:: MimeTypes(filenames=(), strict=True)
204204

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

224224

225225
.. attribute:: MimeTypes.encodings_map
226226

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

230230

231231
.. attribute:: MimeTypes.types_map
232232

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

238239

239240
.. attribute:: MimeTypes.types_map_inv
240241

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

246248

247249
.. method:: MimeTypes.guess_extension(type, strict=True)

pr-preview/pr-1231/_sources/library/site.rst.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,10 @@ Module contents
245245

246246
Return a list containing all global site-packages directories.
247247

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

252253
.. versionadded:: 3.2
253254

pr-preview/pr-1231/_sources/library/xml.dom.minidom.rst.txt

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,29 @@ rules apply:
249249
Instead, :mod:`!xml.dom.minidom` uses standard Python exceptions such as
250250
:exc:`TypeError` and :exc:`AttributeError`.
251251

252-
* :class:`NodeList` objects are implemented using Python's built-in list type.
253-
These objects provide the interface defined in the DOM specification, but with
254-
earlier versions of Python they do not support the official API. They are,
255-
however, much more "Pythonic" than the interface defined in the W3C
256-
recommendations.
252+
* Each of the :class:`~xml.dom.NodeList` and :class:`~xml.dom.NamedNodeMap`
253+
interfaces has two implementations, which provide additional methods and
254+
operations.
255+
256+
:attr:`~xml.dom.Node.childNodes` is a subclass of :class:`list`, or, for
257+
nodes which cannot have children, a subclass of :class:`tuple`.
258+
It supports iteration, concatenation, indexing and slicing.
259+
260+
:attr:`~xml.dom.Node.attributes` supports ``len()``, the :keyword:`in`
261+
operator, subscription by a name or by a ``(namespaceURI, localName)``
262+
tuple, assignment and deletion, and the methods :meth:`!get`, :meth:`!keys`,
263+
:meth:`!keysNS`, :meth:`!values`, :meth:`!items` and :meth:`!itemsNS`.
264+
:attr:`~xml.dom.DocumentType.entities` and
265+
:attr:`~xml.dom.DocumentType.notations` are read-only and support only
266+
``len()`` and subscription by a name.
267+
268+
* :attr:`~xml.dom.Document.strictErrorChecking` and
269+
:attr:`~xml.dom.Attr.specified` are always ``False``.
270+
271+
* :meth:`~xml.dom.Element.removeAttribute` and
272+
:meth:`~xml.dom.Element.removeAttributeNS` raise
273+
:exc:`~xml.dom.NotFoundErr` if there is no matching attribute,
274+
while the DOM specifies that this has no effect.
257275

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

0 commit comments

Comments
 (0)