This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steven.daprano
Recipients ncoghlan, steven.daprano
Date 2018-01-18.06:52:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1516258331.4.0.467229070634.issue32590@psf.upfronthosting.co.za>
In-reply-to
Content
Oh I can just imagine the bike-shedding on this one :-)

I'm not really convinced this is needed, but for what it's worth I think that given the intended use-case (checking function parameters) ValueError would be a more appropriate default exception type. The given argument has the wrong value, hence ValueError.

On the other hand, it is more common (at least for me) to check arguments with isinstance, so maybe the default should be TypeError.

Definitely needs a PEP.
History
Date User Action Args
2018-01-18 06:52:11steven.dapranosetrecipients: + steven.daprano, ncoghlan
2018-01-18 06:52:11steven.dapranosetmessageid: <1516258331.4.0.467229070634.issue32590@psf.upfronthosting.co.za>
2018-01-18 06:52:11steven.dapranolinkissue32590 messages
2018-01-18 06:52:11steven.dapranocreate