elastic / elastic/opbeans-python
Example error that demonstrates why local vars are so useful
オープン
- 主要言語
- Python
- スター
- 7
- フォーク
- 14
- 平均マージ
- 14時間 16分
- マージ済み PR(30日)
- 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 はまだ評価されていません。