dry-python / dry-python/lambdas

Prevent Python from treating _Callable an iterable

Đang mở
#116 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
286
Fork
6
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

## Problem
Due to lack of `__iter__` implementation, Python is attempting to iterate over `_Callable` when possible. It's generally an undesired behavior, given the purposes of the `_Callable` class.

You can easily reproduce the issue:
```python
[*__import__("lambdas")._]
```

## Implementation

That should be a no-brainer to fix and write tests for.

```
class _Callable:
__iter__ = None
```

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.