On Fri, May 1, 2020 at 4:34 AM Ram Rachum <r...@rachum.com> wrote:

> On Fri, May 1, 2020 at 10:28 AM Serhiy Storchaka <storch...@gmail.com>
> wrote:
>
>> 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.
>>
>
> That's not a reasonable request.
>
If there's enough support for this idea, then I'll be happy to start
> working on this, but even then it'll be a collaborative effort.
>

I believe the first step would be to show that which combination of
current_exception + messages should be split into various new exceptions.

To give a possible concrete example, if you have a look at
https://aroberge.github.io/friendly-traceback-docs/docs/html/tracebacks_en_3.6.html,
you will see that TypeError can have various messages such as:

* must be X not Y  (where X might be str and Y might be list, etc.)
* can only concatenate X (not Y) to X
* unsupported operand type(s) X for: Y and Z
* X not supported between instances of Y and Z
* bad operand type for unary X: Y
* X object does not support item assignment
* X takes Y positional arguments but Z was given
* X missing 2 required positional arguments: Y and Z
* X object is not callable

There are likely many more cases only for TypeError (not to mention other
types of errors.)

Note that there are actual tests for each of these (which is one important
criterion as mentioned by Serhly). (This comment does not mean that I am
not necessarily expressing support for adding many new exception types.)

You're welcome to start collaborating and help document all possible
cases.   This invitation to collaborate is, of course open to all.

André Roberge



> _______________________________________________
> 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/IVNKPAYM3HT67CMULVUIOT35USUWWW6L/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
_______________________________________________
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/YELQDSYP4TAMP3OJ2UP6CRQVHDBA4HVS/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to