dry-python / dry-python/lambdas

Prevent Python from treating _Callable an iterable

Open
#116 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
286
Forks
6
PR merge metrics
No merged PRs in 30d

Description

## 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
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.