elastic / elastic/opbeans-python
Example error that demonstrates why local vars are so useful
Abierto
- Lenguaje dominante
- Python
- Estrellas
- 7
- Forks
- 14
- Merge medio
- 14 h 16 min
- PR fusionados (30 d)
- 1
Descripción
Would be lovely to have an example error that shows why local variables are so useful. For example when debugging why some regex doesn't match. Let's say the developer assumed the regex would capture a group and then do something with it?
```python
phone_num = self.cleaned_data['phone']
country_code = phone_num.match(phone_num, '$(\+\d+)\-').groups[1]
```
throws an IndexError because there's no country code in the telephone number.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.