Martin v. Löwis added the comment: I'm not sure we are looking at the same code base, I look at
http://hg.python.org/cpython/file/b56ce3410ca6/Lib/collections/__init__.py#l401 and ISTM that collections.Counter is *not* implemented in C. Also, according to http://hg.python.org/cpython/file/b56ce3410ca6/Include/object.h#l486 I see that _PyType_LookupId is *not* in the limited API (and it really shouldn't). In any case, _PyType_LookupId cannot replace PyType_GetSlot, since it returns a PyObject* from the namespace of the type. Many of the slots don't actually have a Python name (including tp_free, which is the OP's original use case), plus the value returned ought to be a function pointer, not a PyObject*. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue17162> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com