01.05.20 09:48, Ram Rachum пише:
I wish there were a 100 more built-in exceptions in Python, that will be
very specific about what went wrong.
If I do this:
>>> x, y = range(3)
I know it'll raise a ValueError, because I've memorized that, but it did
take me a few years to remember where I should expect ValueError and
where I should expect TypeError.
It would be nice if the operation above raised UnpackingOverflowError,
which will be a subclass of UnpackingError, along with
UnpackingUnderflowError. UnpackingError can be a subclass of ValueError,
for backward compatibility.
Could you please provide a list of these 100 exceptions? If you create a
PR, with documentation and tests, it would be a good start of the
discussion.
_______________________________________________
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/M52MP2IYUDMBPKD3SPTFFDQHKKQ7RYXQ/
Code of Conduct: http://python.org/psf/codeofconduct/