Hi,
I started optimising cascaded assignments a little to reduce the
unnecessary duplication of coercions. While doing that, I found this test
in memslice.pyx:
'''
def cascaded_buffer_assignment(obj):
"""
>>> A = IntMockBuffer("A", range(6))
>>> cascaded_buffer_assignment(A)
acquired A
acquired A
released A
released A
"""
cdef int[:] a, b
a = b = obj
'''
It's explicitly tested for that we create two independent memory views in
this case. Is there an actual reason for this? As long as the types of a
and b are identical, I don't see why we would want to request the buffer twice.
Stefan
_______________________________________________
cython-devel mailing list
[email protected]
https://mail.python.org/mailman/listinfo/cython-devel