Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment: PySequence_Length(o) is equivalent to the Python expression len(o) only if o is a sequence. dict is not a sequence. You must use a correct API:
PyObject_Size() -- for general objects. PyMapping_Size() -- if the object is a mapping. PyDict_Size() -- if the object is a concrete dict. ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32500> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com