exercism / exercism/python

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

Đang mở
#1,780 11 bình luận 0 reaction 1 người được giao Được @BethanyG nhận Xem trên GitHub
bug 🐛 smolder🍲
Ngôn ngữ chính
Python
Star
2.5k
Fork
1.5k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.