mirror of
https://github.com/python/cpython.git
synced 2025-10-06 23:21:06 +00:00
bpo-43908: Make array.array type immutable (GH-25696)
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
5daf70b22e
commit
c6ad03fddf
3 changed files with 10 additions and 1 deletions
|
@ -40,6 +40,12 @@ class MiscTest(unittest.TestCase):
|
|||
self.assertRaises(TypeError, array.array, 'xx')
|
||||
self.assertRaises(ValueError, array.array, 'x')
|
||||
|
||||
@support.cpython_only
|
||||
def test_immutable(self):
|
||||
# bpo-43908: check that array.array is immutable
|
||||
with self.assertRaises(TypeError):
|
||||
array.array.foo = 1
|
||||
|
||||
def test_empty(self):
|
||||
# Exercise code for handling zero-length arrays
|
||||
a = array.array('B')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue