elastic / elastic/opbeans-python
Example error that demonstrates why local vars are so useful
Open
- Dominant language
- Python
- Stars
- 7
- Forks
- 14
- Avg merge
- 14h 16m
- Merged PRs (30d)
- 1
Description
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.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.