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.

Title: Add 'unexpected_type' to TypeError
Type: enhancement Stage: test needed
Components: Interpreter Core Versions: Python 3.5
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: barry, brett.cannon, ezio.melotti
Priority: normal Keywords:

Created on 2013-06-07 20:55 by brett.cannon, last changed 2022-04-11 14:57 by admin.

Messages (3)
msg190780 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2013-06-07 20:55
TypeError could grow an 'unexpected_type' attribute to store the type of the argument that was used to trigger the exception. Since types are expected to not be deleted there is no GC worry.

Having an 'expected' attribute makes no sense in the face of a union of types, etc. (unless the assumption of a frozenset is made for the attribute). Plus exceptions typically do not contain info on what would have been acceptable (although in this instance it may make sense).
msg228593 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-10-05 17:31
Just a gentle reminder guys.
msg228701 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2014-10-06 14:52
There's actually nothing to remind here since there is no one waiting on input from anyone. Plus this particular issue is covered by .
Date User Action Args
2022-04-11 14:57:46adminsetgithub: 62365
2019-04-26 17:49:52BreamoreBoysetnosy: - BreamoreBoy
2014-10-06 14:52:20brett.cannonsetmessages: + msg228701
2014-10-05 17:31:36BreamoreBoysetnosy: + BreamoreBoy

messages: + msg228593
versions: + Python 3.5, - Python 3.4
2013-06-15 21:06:07ezio.melottisetnosy: + ezio.melotti
2013-06-07 21:24:11barrysetnosy: + barry
2013-06-07 20:55:26brett.cannoncreate