On 6 Nov 2014 06:53, "Alexander Belopolsky" <alexander.belopol...@gmail.com>
wrote:
>
>
> On Wed, Nov 5, 2014 at 2:47 PM, R. David Murray <rdmur...@bitdance.com>
wrote:
>>
>> As I said on the issue, there is no reason I can see to add extra code
>> just to turn an AttributeError into a TypeError.  The AttributeError
>> works just fine in letting you know your input type didn't work.
>
>
> +1
>
> Unlike ValueError or LookupError, TypeError and AttributeError indicate a
logical problem with the code rather than an issue with the user input.
>From the programmer perspective, any code that catches and mutates
exceptions is a nuisance.

Right. Especially in a ducktyping context, AttributeError and TypeError are
often functionally equivalent - it usually isn't worthwhile adding code
specifically to turn one into the other.

The case that doesn't throw an exception at all seems a little strange, but
I haven't looked into the details.

Regards,
Nick.

>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev@python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
https://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com
>
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to