-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Span __hash__
and __eq__
are incompatible
#4965
Comments
That's a very charitable explanation for everything! I think it's more likely an oversight that the comparison functions weren't updated when more attributes were added. Since it's deprecated, we might want to replace the Off the top of my head I'm not totally sure how to compare labels or kb ids, e.g.:
But |
In that case, is there an easy replacement to check that two |
I take what I said about
I don't think there's an easy replacement, but if I think you might have to just write a utility function to compare the offsets if that's what you're interested in. I'd have to think about whether there's an elegant way to add this to the library. |
Not cross-document, even if that might make some sense if you process the same input and can guarantee that the tokenization is the same but that seems to specific. So I think either a token-by-token comparison or checking that the parent |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
From
__hash__
docWhile right now
Gives
I understand the rationale here: it is convenient to be able to check that
Span
s effectively cover the same spans, whileSpan
s bearing different annotations are conceptually different, but it makes functions that depend on hash fail in counter-intuitive ways such asOr the specific issue that made me notice this
The text was updated successfully, but these errors were encountered: