How to get which attribute causes the AttributeError except inspecting strings?

Xiang Zhang zhangyangyu0614 at gmail.com
Mon Mar 7 11:25:33 EST 2016


Hi,

I know I can get the attribute name in some way, but since I just want the attribute name when an AttributeError caused by it raised, I really don't want to inspect the string or introduce one more layer over getattr. I hope I can get the attribute which causes the exception from the AttributeError raised directly. But it seems I can't.



More information about the Python-list mailing list