Bradley Froehle added the comment: This rather obscure bug seems to be caused by a failure to properly initialize PyCell_Type.
Running with GDB, we see that _PyType_Lookup(<class 'cell'>, "__dir__") fails in: /* Look in tp_dict of types in MRO */ mro = type->tp_mro; /* If mro is NULL, the type is either not yet initialized by PyType_Ready(), or already cleared by type_clear(). Either way the safest thing to do is to return NULL. */ if (mro == NULL) return NULL; Since: (gdb) print PyCell_Type->tp_mro $9 = (PyObject *) 0x0 Searching the code base shows that we never call PyType_Ready(&PyCell_Type). A patch is attached. ---------- keywords: +patch nosy: +bfroehle Added file: http://bugs.python.org/file27783/init_cell_type.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue16268> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com