Skip to content
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

Equals TypeError #13057

Closed
TristynAlxander opened this issue Oct 11, 2023 · 2 comments · Fixed by #13058
Closed

Equals TypeError #13057

TristynAlxander opened this issue Oct 11, 2023 · 2 comments · Fixed by #13058
Labels
bug Bugs and behaviour differing from documentation feat / doc Feature: Doc, Span and Token objects

Comments

@TristynAlxander
Copy link

TristynAlxander commented Oct 11, 2023

How to reproduce the behaviour

nlp = spacy.load("en_core_web_lg")
text = "The quick brown fox jumps over the lazy dog"
doc = nlp(text)
token = doc[0]
span = doc[0:1]
print(span == token)

Actual Result: TypeError: Argument 'other' has incorrect type (expected spacy.tokens.span.Span, got spacy.tokens.token.Token)

Expected Result: True or False

Info about spaCy

  • spaCy version: 3.6.1
  • Platform: Linux-6.2.0-34-generic-x86_64-with-glibc2.35
  • Python version: 3.10.10
  • Pipelines: en_core_web_lg (3.6.0)
@adrianeboyd adrianeboyd added bug Bugs and behaviour differing from documentation feat / doc Feature: Doc, Span and Token objects labels Oct 11, 2023
@adrianeboyd adrianeboyd linked a pull request Oct 11, 2023 that will close this issue
3 tasks
@adrianeboyd
Copy link
Contributor

Thanks for the report, that does look like a bug!

Copy link
Contributor

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bugs and behaviour differing from documentation feat / doc Feature: Doc, Span and Token objects
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants