25
A proposal for java's "throws" in python: Extend type hints to cover exceptions
(discuss.python.org)
Welcome to the Python community on the programming.dev Lemmy instance!
Past
November 2023
October 2023
July 2023
August 2023
September 2023
I'm not too familiar with C# (last used it like a decade ago), but I think the rules here would be pretty simple:
And maybe add an option to convert exceptions from a function to an Error value (maybe
some_func?()
to convert to error values? IDK, I haven't thought through that part as much).Hopefully that's simple enough to be useful.
If I were proposing this, I'd limit it to optional chaining since that's far more annoying to me currently.