Update Doc/library/stdtypes.rst

This commit is contained in:
Eric Wieser 2020-08-29 13:36:04 +01:00 committed by GitHub
parent c210029730
commit a352888715
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -3523,6 +3523,9 @@ copying.
``len(view)`` is equal to the length of :class:`~memoryview.tolist`, which
is the nested list representation of the view. If ``view.ndim = 1``,
this is equal to the number of elements in the view.
.. versionchanged:: 3.10
If ``view.ndim = 0``, ``len(view)`` now raises `TypeError` instead of returning 1.
The :class:`~memoryview.itemsize` attribute will give you the number of
bytes in a single element.