aio-libs / aio-libs/multidict

Enhancement: `to_dict` method

Aperta
#783 4 commenti 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
492
Fork
129
Merge medio
14h 28m
PR unite (30g)
35

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.