-
-
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
phrasematcher.pyi has the wrong type annotation for docs
parameter in add
#10234
Comments
Hi Ramon! I'd come across this too and have a fix in an adjacent PR (#9880), but it's not clear when that will be merged, so we can fix this separately for the next patch release instead. If you'd like to submit a PR you are welcome to, but I can also do it if you'd prefer. |
Hey Adriane 😄 Ok sure, I'm happy to submit a PR. The guidelines say I should write a failing test for the bug first, can I skip that since it's more of a "meta problem"? |
Yeah, the types aren't checked directly by the unit tests anyway, so you can skip writing a test for this. |
See #10235. |
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. |
How to reproduce the behaviour
Typecheck any (type-annotated) code that uses
PhraseMatcher.add()
with mypy. You'll get something like:error: List comprehension has incompatible type List[Doc]; expected List[List[Dict[str, Any]]]
mypy is correct because line 17 of phrasematcher.pyi actually reads
docs: List[List[Dict[str, Any]]],
, but it should probably bedocs: List[Doc]
according to https://spacy.io/api/phrasematcher#add.Your Environment
The text was updated successfully, but these errors were encountered: