Argument-Clinic / cpython

The Python programming language
https://www.python.org/
Other
1 stars 0 forks source link

What to do with `fail` and `warn`? #32

Open erlend-aasland opened 10 months ago

erlend-aasland commented 10 months ago

fail and warn are painful, because they access the global clinic object (in order to fetch the current line number). We should really try to simplify this. A more pythonic way would IMO to just use exceptions. We could add a basal set of exceptions (parse errors, programming errors, converter error, etc.), and use these instead. For parse errors, we could catch these in the parser state machine, add the line number, and re-raise.