[New-bugs-announce] [issue18165] Add 'unexpected_type' to TypeError
report at bugs.python.org
Fri Jun 7 22:55:26 CEST 2013
New submission from Brett Cannon:
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).
components: Interpreter Core
stage: test needed
title: Add 'unexpected_type' to TypeError
versions: Python 3.4
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce