[docs] In xml.etree.ElementTree docs there are many absent Element class links (issue 28234)
bugzilla-mail-box at yandex.ru
bugzilla-mail-box at yandex.ru
Thu Sep 22 02:02:26 EDT 2016
Reviewers: vadmium,
http://bugs.python.org/review/28234/diff/18635/Doc/library/xml.etree.elementtree.rst
File Doc/library/xml.etree.elementtree.rst (right):
http://bugs.python.org/review/28234/diff/18635/Doc/library/xml.etree.elementtree.rst#newcode507
Doc/library/xml.etree.elementtree.rst:507: :class:`Element` instance.
Returns a true value if this is an element object.
On 2016/09/22 03:36:09, vadmium wrote:
> This does not make much sense. How could *element* be an Element class
instance,
> but _not_ an “element object”? Maybe drop at least one of the
sentences?
>
The second sentence can be inserted to the third sentence (to the end)
instead of "element object".
"Returns a true value if this is an :class:`Element` instance."
Please review this at http://bugs.python.org/review/28234/
Affected files:
Doc/library/xml.etree.elementtree.rst
diff --git a/Doc/library/xml.etree.elementtree.rst b/Doc/library/xml.etree.elementtree.rst
index 99d7e8b..719121f 100644
--- a/Doc/library/xml.etree.elementtree.rst
+++ b/Doc/library/xml.etree.elementtree.rst
@@ -466,7 +466,7 @@ Functions
Comment element factory. This factory function creates a special element
that will be serialized as an XML comment by the standard serializer. The
comment string can be either a bytestring or a Unicode string. *text* is a
- string containing the comment string. Returns an element instance
+ string containing the comment string. Returns an :class:`Element` instance
representing a comment.
Note that :class:`XMLParser` skips over comments in the input
@@ -504,7 +504,7 @@ Functions
.. function:: iselement(element)
Checks if an object appears to be a valid element object. *element* is an
- element instance. Returns a true value if this is an element object.
+ :class:`Element` instance. Returns a true value if this is an element object.
.. function:: iterparse(source, events=None, parser=None)
@@ -551,7 +551,7 @@ Functions
PI element factory. This factory function creates a special element that
will be serialized as an XML processing instruction. *target* is a string
containing the PI target. *text* is a string containing the PI contents, if
- given. Returns an element instance, representing a processing instruction.
+ given. Returns an :class:`Element` instance, representing a processing instruction.
Note that :class:`XMLParser` skips over processing instructions
in the input instead of creating comment objects for them. An
@@ -572,14 +572,14 @@ Functions
.. function:: SubElement(parent, tag, attrib={}, **extra)
- Subelement factory. This function creates an element instance, and appends
+ Subelement factory. This function creates an :class:`Element` instance, and appends
it to an existing element.
The element name, attribute names, and attribute values can be either
bytestrings or Unicode strings. *parent* is the parent element. *tag* is
the subelement name. *attrib* is an optional dictionary, containing element
attributes. *extra* contains additional attributes, given as keyword
- arguments. Returns an element instance.
+ arguments. Returns an :class:`Element` instance.
.. function:: tostring(element, encoding="us-ascii", method="xml", *, \
@@ -742,7 +742,7 @@ Element Objects
.. method:: find(match, namespaces=None)
Finds the first subelement matching *match*. *match* may be a tag name
- or a :ref:`path <elementtree-xpath>`. Returns an element instance
+ or a :ref:`path <elementtree-xpath>`. Returns an :class:`Element` instance
or ``None``. *namespaces* is an optional mapping from namespace prefix
to full name.
@@ -863,7 +863,7 @@ ElementTree Objects
Replaces the root element for this tree. This discards the current
contents of the tree, and replaces it with the given element. Use with
- care. *element* is an element instance.
+ care. *element* is an :class:`Element` instance.
.. method:: find(match, namespaces=None)
@@ -1001,7 +1001,7 @@ TreeBuilder Objects
can use this class to build an element structure using a custom XML parser,
or a parser for some other XML-like format. *element_factory*, when given,
must be a callable accepting two positional arguments: a tag and
- a dict of attributes. It is expected to return a new element instance.
+ a dict of attributes. It is expected to return a new :class:`Element` instance.
.. method:: close()
More information about the docs
mailing list