[issue31648] Improve ElementPath

2017-09-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your contribution Stefan! Good improvement. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue31648] Improve ElementPath

2017-09-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 101a5e84acbab9d880e150195f23185dfb5449a9 by Serhiy Storchaka (scoder) in branch 'master': bpo-31648: Improve ElementPath (#3835) https://github.com/python/cpython/commit/101a5e84acbab9d880e150195f23185dfb5449a9 -- ___

[issue31648] Improve ElementPath

2017-09-30 Thread Stefan Behnel
Stefan Behnel added the comment: Thanks for noticing. I added a test and fixed it. -- ___ Python tracker ___ ___ Python-bugs-list ma

[issue31648] Improve ElementPath

2017-09-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think the break in the loop for [.='text'] is not correct. >>> from xml.etree import ElementTree as ET >>> e = >>> ET.XML('texttext') >>> list(e.findall('.//a[b="text"]')) [, ] >>> list(e.findall('.//a[.="text"]')) [] I expect that findall() finds all mat

[issue31648] Improve ElementPath

2017-09-30 Thread Stefan Behnel
Stefan Behnel added the comment: Well, there's XPath for a standard: https://www.w3.org/TR/xpath/ ElementPath deviates from it in its namespace syntax (it allows "{ns}tag" where XPath requires "p:tag" prefixes), but that's about it. All other differences are basically needless limitations of

[issue31648] Improve ElementPath

2017-09-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Is this feature already implemented in lxml? Is it a part of some wider standard? -- ___ Python tracker ___ ___

[issue31648] Improve ElementPath

2017-09-30 Thread Stefan Behnel
Change by Stefan Behnel : -- keywords: +patch pull_requests: +3816 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-lis

[issue31648] Improve ElementPath

2017-09-30 Thread Stefan Behnel
New submission from Stefan Behnel : * Allow whitespace around predicate parts, i.e. "[a = 'text']" instead of requiring the less readable "[a='text']". * Add support for text comparison of the current node, like "[.='text']". Both currently raise "invalid path" exceptions. PR coming.