Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Enhancement: to_dict method #783

@Goldziher

Description

@Goldziher

Hi there,

Thanks for this library. I'd like to ask for a convenience method that output a dict of a multidict - with lists for multi-values. Currently I have this:

    def dict(self) -> Dict[str, List[Any]]:
        """

        Returns:
            A dict of lists
        """
        return {k: self.getall(k) for k in set(self.keys)}

While this works, its not very performant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions