Skip to content

requests.Session.headers missing copy method #3042

Closed

Description

@connorskees

requests.Session().headers has a type of CaseInsensitiveDict; however, it is defined as being a MutableMapping[Text, Text] and so is missing a copy() method. Mypy incorrectly raises an error, error: "MutableMapping[str, str]" has no attribute "copy"

headers: MutableMapping[Text, Text]

The definition for a CaseInsensitiveDict itself is also missing a copy() method

class CaseInsensitiveDict(MutableMapping[str, _VT], Generic[_VT]):

The copy() method is defined here
https://github.com/kennethreitz/requests/blob/4983a9bde39c6320aa4f3e34e50dac6e263dab6f/requests/structures.py#L80

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions