Nick Coghlan added the comment:

The information we want to include in the chained exception:

1. The name of the offending attribute (since the traceback will point to the 
class header, not to the assignment)
2. The repr of the offending attribute (since the innner exception will refer 
to the return value from "attr.__set_name__" rather then the value assigned to 
the attribute)

The other idea I mentioned (allowing "__set_name__ = None" to prevent falling 
back to "__getattr__") needs a bit more consideration, as I don't quite recall 
where we're currently at in terms of expanding that idiom beyond "__hash__" and 
to the other one-shot ABCs.


Python tracker <>
Python-bugs-list mailing list

Reply via email to