Message317104
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. |
|
Date |
User |
Action |
Args |
2018-05-19 06:36:11 | carljm | set | recipients:
+ carljm, ncoghlan |
2018-05-19 06:36:11 | carljm | set | messageid: <1526711771.07.0.682650639539.issue33576@psf.upfronthosting.co.za> |
2018-05-19 06:36:11 | carljm | link | issue33576 messages |
2018-05-19 06:36:10 | carljm | create | |
|