[issue35013] Add more type checks for children of xml.etree.ElementTree.Element

2018-10-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If there wouldn't type checks in append(), extend() and insert(), I would consider to add the support of duck-typing in iterating and searching. But since non-Elements already are forbidden in the public API, it is better to forbid them everywhere and

[issue35013] Add more type checks for children of xml.etree.ElementTree.Element

2018-10-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset f081fd83032be48aefdb1bbcc38ab5deb03785d5 by Serhiy Storchaka in branch 'master': bpo-35013: Add more type checks for children of Element. (GH-9944) https://github.com/python/cpython/commit/f081fd83032be48aefdb1bbcc38ab5deb03785d5 --

[issue35013] Add more type checks for children of xml.etree.ElementTree.Element

2018-10-19 Thread Stefan Behnel
Stefan Behnel added the comment: Well, if that's what it takes, then that's what it takes. I'm fine with the change. The (unaccelerated) ET doesn't strictly require it, but a) I can't really see a use case for non-Element classes in the tree, b) pretty much no-one uses plain Python ET

[issue35013] Add more type checks for children of xml.etree.ElementTree.Element

2018-10-18 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +9295 stage: -> patch review ___ Python tracker ___ ___

[issue35013] Add more type checks for children of xml.etree.ElementTree.Element

2018-10-18 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : Currently some methods for xml.etree.ElementTree.Element check the type subelements: append(), extend(), insert(). But there are other ways to add non-Element children: __setitem__(), __setstate__(), __deepcopy__(). This could cause crashes later in the