This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: add support for != (not-equals) in ElementTree XPath
Type: enhancement Stage: resolved
Components: XML Versions: Python 3.10
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: ammar2, remi.lapeyre, scoder
Priority: normal Keywords: patch

Created on 2020-05-14 11:25 by Antony.Lee, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 22147 merged ammar2, 2020-09-08 07:21
Messages (3)
msg368829 - (view) Author: Antony Lee (Antony.Lee) * Date: 2020-05-14 11:25
It would be a small usability improvement if ElementTree's XPath support also supported the != (not-equals) operator.
I am specifically mentioning only != and not >/</... because != can be defined as the opposite of =, whereas other operators appear to run into questions of what to do with coercion of strings to numbers, etc.  (I guess that depends on the version of XPath, which may be a question we want to avoid for now.)
msg376544 - (view) Author: Stefan Behnel (scoder) * (Python committer) Date: 2020-09-08 04:45
Agreed that adding "!=" would be a nice improvement, probably not very invasive. PR welcome.

https://www.w3.org/TR/xpath-10/#booleans
msg380572 - (view) Author: Stefan Behnel (scoder) * (Python committer) Date: 2020-11-09 07:02
New changeset 97e8b1eaeaf3aa325c84ff2e13417c30414d0269 by Ammar Askar in branch 'master':
bpo-40624: Add support for the XPath != operator in xml.etree (GH-22147)
https://github.com/python/cpython/commit/97e8b1eaeaf3aa325c84ff2e13417c30414d0269
History
Date User Action Args
2022-04-11 14:59:31adminsetgithub: 84804
2020-11-09 12:44:10Antony.Leesetnosy: - Antony.Lee
2020-11-09 07:04:04scodersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-11-09 07:02:59scodersetmessages: + msg380572
2020-09-08 07:21:27ammar2setkeywords: + patch
nosy: + ammar2

pull_requests: + pull_request21229
stage: needs patch -> patch review
2020-09-08 04:45:49scodersetversions: + Python 3.10, - Python 3.9
nosy: + scoder

messages: + msg376544

type: enhancement
stage: needs patch
2020-05-14 15:23:30remi.lapeyresetnosy: + remi.lapeyre
2020-05-14 11:25:02Antony.Leecreate