We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Twisted 23.8.0 has improved and fixed type hints around deferreds so now mypy prints some errors:
scrapy/core/scraper.py:184: error: Argument 1 to "addErrback" of "Deferred" has incompatible type "Callable[[Failure, Request, Response, Spider], None]"; expected "Callable[[Failure, Request, Response, Spider], Deferred[<nothing>]]" [arg-type] scrapy/core/scraper.py:184: error: Argument 3 to "addErrback" of "Deferred" has incompatible type "Response | Failure"; expected "Response" [arg-type] scrapy/core/scraper.py:185: error: Argument 1 to "addCallback" of "Deferred" has incompatible type "Callable[[Iterable[Any] | AsyncIterable[Any], Request, Response, Spider], Deferred[Any]]"; expected "Callable[[Any, Request, Response, Spider], Failure]" [arg-type] scrapy/core/scraper.py:185: error: Argument 3 to "addCallback" of "Deferred" has incompatible type "Response | Failure"; expected "Response" [arg-type] scrapy/core/downloader/__init__.py:157: error: Need type annotation for "deferred" [var-annotated] scrapy/core/engine.py:223: error: Incompatible return value type (got "None", expected "Failure") [return-value] scrapy/core/engine.py:300: error: Argument 1 to "addBoth" of "Deferred" has incompatible type "Callable[[Response | Request, Request], Deferred[Any] | Response]"; expected "Callable[[Any | Failure, Request], Failure]" [arg-type]
(I omitted some unhelpful mypy tips). This needs reviewing, as it's not clear at the first glance if we have any problems with code and/or type hints.
The text was updated successfully, but these errors were encountered:
I'm fine with not fixing it when we re-enable that Twisted version in 2.10.2 and letting the test fail for the 2.10 branch.
Sorry, something went wrong.
wRAR
Successfully merging a pull request may close this issue.
Twisted 23.8.0 has improved and fixed type hints around deferreds so now mypy prints some errors:
(I omitted some unhelpful mypy tips). This needs reviewing, as it's not clear at the first glance if we have any problems with code and/or type hints.
The text was updated successfully, but these errors were encountered: