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

type annotation of "headers" argument of scrapy.Request is incomplete #5989

Closed
kmike opened this issue Jul 26, 2023 · 1 comment · Fixed by #6097
Closed

type annotation of "headers" argument of scrapy.Request is incomplete #5989

kmike opened this issue Jul 26, 2023 · 1 comment · Fixed by #6097
Assignees
Milestone

Comments

@kmike
Copy link
Member

kmike commented Jul 26, 2023

Currently scrapy.Request(headers=...) argument is annotated as Optional[dict]. But we allow other options, e.g. a list of (name, value) pairs, which allow to set multiple headers with the same name. Headers instance may also be an option for the users to pass. I think we should ensure that none of this raises mypy typing errors.

@wRAR
Copy link
Member

wRAR commented Sep 21, 2023

Correct and full typing of CaselessDict and Headers doesn't seem possible, so I think I'll just document the interface and silence the incompatibilities where needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants