exercism / exercism/python

[Error-Handling]: instructions are unclear, and wrong programs pass the tests

未關閉
#1,780 11 則留言 0 個 reaction 已指派 1 人 已被 @BethanyG 認領 在 GitHub 檢視
bug 🐛 smolder🍲
主要語言
Python
星號
2.5k
分支
1.5k
PR 合併指標
30 天內沒有已合併 PR

描述

I just did the error-handling exercise, and had several issues:

- It was unclear at first what to do with inputs. Looking at the tests, it seemed that trying to convert the input to `int` was the right thing to try, but this is not mentioned in the readme or the stubs.
- The test for whether a method throws an exception will pass any error that might occur, not just if it's intentionally raised:
```python
def handle_error_by_throwing_exception():
raise "(╯°□°)╯︵ ┻━┻" # Raising a string is a TypeError, but passes the test
```
- When returning a tuple, which element should be the result and which one the status? What should the result element be when it fails? No suggestion
- No mention of advantages or disadvantages of the different kinds of error handling, or what is idiomatic Python.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。