Message255778
> Yury, can you help me understand why `hasattr("foo", "bar")` triggers the infinite loop there, but not `print("foo")`?
hasattr uses getattr under the hood. getattr raises an AttributeError, and that triggers PyErr_SetError, which has an infinite "while" loop. Instead of "hasattr" you can use anything that raises an error. |
|
Date |
User |
Action |
Args |
2015-12-02 20:42:08 | yselivanov | set | recipients:
+ yselivanov, gvanrossum, ncoghlan, vstinner, oconnor663 |
2015-12-02 20:42:08 | yselivanov | set | messageid: <1449088928.24.0.557699402309.issue25779@psf.upfronthosting.co.za> |
2015-12-02 20:42:08 | yselivanov | link | issue25779 messages |
2015-12-02 20:42:08 | yselivanov | create | |
|