dry-python / dry-python/lambdas

Prevent Python from treating _Callable an iterable

Offen
#116 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
286
Forks
6
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

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