Sorry I probably wasn't clear enough in what I was suggesting.
> The main question here is why using a hint or a decorator should be > better than a simple documentation. For the same reason type hints are better than documentation - 1. static analysis can catch a multitude of potential errors that humans often miss. 2. type hints stay with code in a way documentation often doesn't 3. developers are often forced to keep type hints up to date to get tests to pass the same is very rarely true of documentation, this would apply to "exceptions raised" too. If the goal is to force people to manage the exception, no, thanks. Total agree. Here we can take some lessons from rust, but not try to make python into something it's not (a system language). I would suggest: 1. "possible exceptions" information should be for static analysis only - so it would only come into play if you used a static analysis tool anyway, like type hints. 2. We should have some easy way to say "let this error propagate", rust uses very nice question mark at the end of a line syntax, python could use something similar one day, until then a magic comment, wrapper function or context function could be used. -- Samuel Colvin
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/RF27BCESZR26N5CJ4G6EKHH7IBYNCDTG/ Code of Conduct: http://python.org/psf/codeofconduct/