Message363159
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. |
|
Date |
User |
Action |
Args |
2020-03-02 11:32:39 | Eric Wieser | set | recipients:
+ Eric Wieser, skrah |
2020-03-02 11:32:39 | Eric Wieser | set | messageid: <1583148759.03.0.250479496174.issue39610@roundup.psfhosted.org> |
2020-03-02 11:32:39 | Eric Wieser | link | issue39610 messages |
2020-03-02 11:32:38 | Eric Wieser | create | |
|