]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-83791: Raise TypeError for len(memoryview_0d) (#18463)
authorEric Wieser <wieser.eric@gmail.com>
Sat, 22 Apr 2023 16:32:47 +0000 (17:32 +0100)
committerGitHub <noreply@github.com>
Sat, 22 Apr 2023 16:32:47 +0000 (17:32 +0100)
commit3d2a46845b67407e2436d910b2e1740c34f4f10d
tree607d43aa0a30a293fcffc2623453cc7787687edd
parentcaed49448d195565940caf198cf0edda65ee5679
gh-83791: Raise TypeError for len(memoryview_0d) (#18463)

Changes the behaviour of `len` on a zero-dimensional `memoryview` to raise `TypeError`. Previously, `len` would return `1`.
Doc/library/stdtypes.rst
Lib/test/test_buffer.py
Lib/test/test_ctypes/test_pep3118.py
Misc/NEWS.d/next/Core and Builtins/2020-02-11-15-54-40.bpo-39610.fvgsCl.rst [new file with mode: 0644]
Objects/memoryobject.c