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 ncoghlan
Recipients ncoghlan
Date 2018-05-19.05:41:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1526708479.7.0.682650639539.issue33576@psf.upfronthosting.co.za>
In-reply-to
Content
Type creation currently wraps all exceptions raised by __set_name__ calls with a generic RuntimeError: https://github.com/python/cpython/blob/master/Objects/typeobject.c#L7263

Unfortunately, this makes it difficult to use __set_name__ for descriptor validation operations, since it means the specific exception type gets lost, and it makes the traceback much harder to read (since the generic error messages appears at the end, while the actual error appears somewhere in the middle).

See https://bugs.python.org/issue21145#msg317097 for a specific example.
History
Date User Action Args
2018-05-19 05:41:19ncoghlansetrecipients: + ncoghlan
2018-05-19 05:41:19ncoghlansetmessageid: <1526708479.7.0.682650639539.issue33576@psf.upfronthosting.co.za>
2018-05-19 05:41:19ncoghlanlinkissue33576 messages
2018-05-19 05:41:19ncoghlancreate