Skip to content

Conversation

@AlexWaygood
Copy link
Member

Fixes#7632

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

fromtyping_extensionsimportTypeAlias

fromurllib3import_collections
fromurllib3._collectionsimportRecentlyUsedContainer
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fromurllib3._collectionsimportRecentlyUsedContainer
fromurllib3._collectionsimportRecentlyUsedContainerasRecentlyUsedContainer

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did that initially, but stubtest called me out. Turns out that it doesn't actually exist at runtime, we just use it for annotations in the stub. Not sure why stubtest didn't flag it before now.

Source: https://github.com/psf/requests/blob/main/requests/sessions.py

Stubtest: https://github.com/python/typeshed/runs/6046468647?check_suite_focus=true

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh interesting. stubtest's checking of type aliases is a little loose, see https://github.com/python/mypy/blob/ce858a6a0c85206ff877faf702293a9b67fae750/mypy/stubtest.py#L960 (I don't quite remember why I did it this way, maybe worth reinvestigating)

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing update method on the CaseInsensitiveDict

3 participants

@AlexWaygood@hauntsaninja