-
Notifications
You must be signed in to change notification settings - Fork 578
Closed
Labels
bugSomething isn't workingSomething isn't workingcoreRelates to core functionality of RDFLib, i.e. `rdflib.{graph,store,term}`Relates to core functionality of RDFLib, i.e. `rdflib.{graph,store,term}`regressionSomething stopped workingSomething stopped working
Description
Hi!
Since RDFLib 6.2.0, it's no longer possible to check the equality of two Path
objects with ==
.
With RDFLib 6.1.1:
>>> from rdflib import DCTERMS, DCAT
>>> DCTERMS.temporal / DCAT.endDate == DCTERMS.temporal / DCAT.endDate
True
With RDFLib 6.2.0 and 6.3.0:
>>> from rdflib import DCTERMS, DCAT
>>> DCTERMS.temporal / DCAT.endDate == DCTERMS.temporal / DCAT.endDate
False
This is most likely due to PR #1528. The __eq__()
method of the Path
class was removed, while functools.total_ordering
apparently requires it:
The class must define one of
__lt__()
,__le__()
,__gt__()
, or__ge__()
. In addition, the class should supply an__eq__()
method.
This also explains why membership tests currently don't work, as mentionned in the issue #2242.
Adding back the __eq__()
method from RDFLib 6.1.1 should solve everything?
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingcoreRelates to core functionality of RDFLib, i.e. `rdflib.{graph,store,term}`Relates to core functionality of RDFLib, i.e. `rdflib.{graph,store,term}`regressionSomething stopped workingSomething stopped working