Message265018
| Author |
serhiy.storchaka |
| Recipients |
eric.smith, gvanrossum, serhiy.storchaka, terry.reedy, ztane |
| Date |
2016年05月06日.20:09:08 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1462565348.96.0.1013750194.issue26906@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
There is one test (ClassPropertiesAndMethods.test_mutable_bases_with_failing_mro in test_descr) that crashes with the code from issue551412 because _PyType_Lookup() is recursive called from PyType_Ready(). Is this the reason? My patch prevents recursive calls.
Here is minimal example (for Python 3):
class M(type):
def mro(self):
hasattr(self, 'foo')
return type.mro(self)
class C(metaclass=M):
pass
When class C is created, C.mro() is called while C still is not ready. Resolving an attribute calls _PyType_Lookup() which calls PyType_Ready() which calls mro() etc. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2016年05月06日 20:09:09 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, gvanrossum, terry.reedy, eric.smith, ztane |
| 2016年05月06日 20:09:08 | serhiy.storchaka | set | messageid: <1462565348.96.0.1013750194.issue26906@psf.upfronthosting.co.za> |
| 2016年05月06日 20:09:08 | serhiy.storchaka | link | issue26906 messages |
| 2016年05月06日 20:09:08 | serhiy.storchaka | create |
|