Stefan Krah <ste...@bytereef.org> added the comment: Yes, the signatures are weird. In PyBuffer_FromContiguous(), "len" is the size of "buf" in bytes.
If "buf" contains 6 floats, but "view" only has space for 4, then only 4 are copied into "view". To avoid that sort of thing, I changed PyBuffer_ToContiguous() to be more restrictive in 3.3, but kept the len parameter. In PyBuffer_ToContiguous() it would not matter though if len(buf) > src->len, in which case buf would contain uninitialized bytes at the end. TBH, I don't think these functions are used very often. :-) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33126> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com