You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
assignee='https://github.com/skrah'closed_at=Nonecreated_at=<Date2020-02-11.15:42:52.359>labels= ['interpreter-core', '3.8', 'type-bug', '3.7', '3.9']
title='memoryview.__len__ should raise an exception for 0d buffers'updated_at=<Date2020-09-07.17:25:22.315>user='https://bugs.python.org/EricWieser'
It seems bizarre to have this object pretend to be a sequence when you ask for its length, yet not behave like one when you actually try to use this length. I'd suggest cpython should behave like numpy here, and fail:
TypeError: len() of unsized object
Perhaps TypeError: cannot get length of 0-dim memory would be more appropriate as a message.
Wasn't sure how to classify this, feel free to reclassify
list() has to *interpret* the endianness to display it. The endianness
of the *native* format does not matter. The endianness of an explicit
format matters, since list has to be able to convert non-native formats.
I suggest to look at XND, which is a memoryview on steroids and
has a lot of those features.