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
messages: 190780
nosy: brett.cannon
priority: normal
severity: normal
stage: test needed
status: open
title: Add 'unexpected_type' to TypeError
type: enhancement
versions: Python 3.4

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue18165>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to