aio-libs / aio-libs/multidict

Enhancement: `to_dict` method

Offen
#783 4 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
492
Forks
129
Ø Merge
14 Std. 28 Min.
Gemergte PRs (30 T.)
35

Beschreibung

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:

```python
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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.