STINNER Victor added the comment: > You need to call `x.__len__()` explicitly.
Ah ok :-) I didn't read carefully the initial message. Attached patch should fix the issue on Python 2.7. It uses the same function than builtin_len() to cast the C Py_ssize_t to a Python int or long. ---------- keywords: +patch Added file: http://bugs.python.org/file42017/wrap_lenfunc.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26423> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com