elastic / elastic/opbeans-python
Example error that demonstrates why local vars are so useful
未关闭
- 主要语言
- Python
- 星标
- 7
- 派生
- 14
- 平均合并
- 14 小时 16 分钟
- 30 天内合并 PR
- 1
描述
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.
贡献指南
这个仓库没有索引到贡献指南
评估
这个 Issue 还没有评估数据。