This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Eric Wieser
Recipients Eric Wieser, skrah
Date 2020-03-02.11:32:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1583148759.03.0.250479496174.issue39610@roundup.psfhosted.org>
In-reply-to
Content
Thanks for pointing out the docs reference, I updated the patch to reword that section.

There's a sentence right before the one you draw attention to which to me reads as another argument to change this:

> ``len(view)`` is equal to the length of :class:`~memoryview.tolist`

On Python 2.7, this gives

>>> len(view_0d)
1
>>> len(view_0d.tolist())
NotImplementedError: tolist() only supports one-dimensional objects

On Python 3.8 before my patch, this gives:

>>> len(view_0d)
1
>>> len(view_0d.tolist())
TypeError: object of type 'int' has no len()

On Python 3.8, with my patch, this gives:

>>> len(view_0d)
TypeError: 0-dim memory has no length
>>> len(view_0d.tolist())
TypeError: object of type 'int' has no len()

As I read it, only with my patch is this sentence satisfied by the implementation.
History
Date User Action Args
2020-03-02 11:32:39Eric Wiesersetrecipients: + Eric Wieser, skrah
2020-03-02 11:32:39Eric Wiesersetmessageid: <1583148759.03.0.250479496174.issue39610@roundup.psfhosted.org>
2020-03-02 11:32:39Eric Wieserlinkissue39610 messages
2020-03-02 11:32:38Eric Wiesercreate