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 carljm
Recipients carljm, ncoghlan
Date 2018-05-19.06:36:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1526711771.07.0.682650639539.issue33576@psf.upfronthosting.co.za>
In-reply-to
Content
Nick, I think the reason this exception wrapping was added is because the stack trace for these exceptions is currently a bit lacking. The "caller" for the `__set_name__` function is the `class` line for the class containing the descriptors.

For exceptions raised _inside_ `__set_name__` this is kind of OK, although if a class has multiple instances of the same descriptor class on it, it doesn't give you an obvious clue which instance raised the exception ( though you can probably figure it out quickly enough by checking the value of the `name` argument).

For cases where the exception is raised at the caller (e.g. a TypeError due to a `__set_name__` method with wrong signature) it's worse; you get no pointer to either the problematic descriptor instance, or its name, or the class; all you get is the TypeError and the class that contains a broken descriptor.

In practice I don't know how much of a problem this is; it doesn't seem likely that it would take too long to narrow down the source of the issue.

Let me know what you think.
History
Date User Action Args
2018-05-19 06:36:11carljmsetrecipients: + carljm, ncoghlan
2018-05-19 06:36:11carljmsetmessageid: <1526711771.07.0.682650639539.issue33576@psf.upfronthosting.co.za>
2018-05-19 06:36:11carljmlinkissue33576 messages
2018-05-19 06:36:10carljmcreate