[Python-ideas] Arguments to exceptions

MRAB python at mrabarnett.plus.com
Thu Jul 6 16:17:59 EDT 2017


On 2017-07-06 02:53, Jeff Walker wrote:
> Stephen,
>      These statements do not ring true to me. I have been following the conversation
> closely and I have not seen support for any of them. Perhaps I missed it.
> Could you please expand on these statements:
> 
>>  the idea doesn't actually solve the problem it is intended to
> 
> Specifically Ken started by saying that it should not be necessary to parse the
> messages to get the components of the message. He then gave an example
> where he was able to access the components of the message without parsing
> the message. So how is it that he is not solving the problem he intended to solve?
> 
>>  His solution can't work
> 
> Again, he gave an example where he was able to access the components of the
> message without parsing the message. Yet you claim his solution cannot work.
> Is his example wrong?
> 
> 
>>  He hasn't demonstrated that there is a real problem
> 
> You yourself admitted that parsing a message to extract the components is
> undesirable. Ken and others, including myself, gave examples where this was
> necessary. Each example was given as either being a real problem or
> representative of a real problem. Are we all wrong?
> 
Sometimes you can't even parse the message.

Here's an annoyance I've just come across:


Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> my_list = ['foo', 'bar']
 >>> my_list.remove('baz')
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
ValueError: list.remove(x): x not in list


If it was a KeyError, it would at least tell me what it was that was 
missing!


More information about the Python-ideas mailing list