[issue28234] In xml.etree.ElementTree docs there are many absent Element class links

2018-10-09 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +9156

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28234] In xml.etree.ElementTree docs there are many absent Element class links

2016-09-23 Thread py.user

py.user added the comment:

Added a reply to the patch about SubElement(). (Realy email notification 
doesn't work in review. I left a message while publication, and it didn't come.)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28234] In xml.etree.ElementTree docs there are many absent Element class links

2016-09-22 Thread py.user

py.user added the comment:

Serhiy Storchaka wrote:
> I believe that in particular you can mix Python and
> C implementations of Element and lxml.etree elements in one tree.


The xml.etree.ElementTree.ElementTree() can accept lxml.etree.Element() as a 
node, but node in node is impossible.

>>> import xml.etree.ElementTree as etree_xml
>>> import lxml.etree as etree_lxml
>>> 
>>> elem1 = etree_xml.Element('a')
>>> elem2 = etree_lxml.Element('b')
>>> elem1.append(elem2)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: must be xml.etree.ElementTree.Element, not lxml.etree._Element
>>>

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28234] In xml.etree.ElementTree docs there are many absent Element class links

2016-09-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The built-in ElementTree package is derived from lxml.etree. I suppose that the 
documentation is inherited from lxml.etree.

The built-in ElementTree package supports duck typing. The element object is 
not always an instance of the Element class. iselement() is not equal to 
isinstance(e, Element), it just tests the existence of the tag attribute. Many 
ElementTree functions have fast path for Element, but work with duck typed 
classes too. I believe that in particular you can mix Python and C 
implementations of Element and lxml.etree elements in one tree.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28234] In xml.etree.ElementTree docs there are many absent Element class links

2016-09-22 Thread Martin Panter

Martin Panter added the comment:

Serhiy, what’s the relevance? In the built-in Element Tree package, it is a 
class: 
.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28234] In xml.etree.ElementTree docs there are many absent Element class links

2016-09-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

In lxml Element is a factory function, not a class.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28234] In xml.etree.ElementTree docs there are many absent Element class links

2016-09-22 Thread py.user

py.user added the comment:

> I left some comments on the code review.
Left an answer on a comment. (ISTM, email notification doesn't work there, I 
didn't get email.)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28234] In xml.etree.ElementTree docs there are many absent Element class links

2016-09-21 Thread Martin Panter

Martin Panter added the comment:

Mostly looks good to me. I left some comments on the code review.

--
nosy: +martin.panter
versions: +Python 2.7, Python 3.5, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28234] In xml.etree.ElementTree docs there are many absent Element class links

2016-09-21 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +eli.bendersky, scoder
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28234] In xml.etree.ElementTree docs there are many absent Element class links

2016-09-21 Thread py.user

New submission from py.user:

https://docs.python.org/3/library/xml.etree.elementtree.html#reference

1. Comment
2. iselement()
3. ProcessingInstruction
4. SubElement
5. Element.find()
6. ElementTree._setroot()
7. TreeBuilder

Applied a patch to the issue that adds Element class links.

--
assignee: docs@python
components: Documentation, Library (Lib), XML
files: element-link.diff
keywords: patch
messages: 277121
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In xml.etree.ElementTree docs there are many absent Element class links
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file44775/element-link.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com