dry-python / dry-python/lambdas

Prevent Python from treating _Callable an iterable

Aperta
#116 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
286
Fork
6
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

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.