aio-libs / aio-libs/multidict

Enhancement: `to_dict` method

Đang mở
#783 4 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
492
Fork
129
Merge trung bình
14 giờ 28 phút
Pull request đã merge (30 ngày)
35

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.