Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert more format changes
  • Loading branch information
aisk committed Dec 20, 2025
commit e00b7a4cd56234d6b386d5fb1e78b04659082d53
12 changes: 3 additions & 9 deletions Lib/test/test_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,6 @@ def test_free_after_iterating(self):
support.check_free_after_iterating(self, reversed, array.array,
(self.typecode,))


class StringTest(BaseTest):

def test_setitem(self):
Expand Down Expand Up @@ -1306,13 +1305,13 @@ def test_delslice(self):
def test_assignment(self):
a = array.array(self.typecode, range(10))
a[::2] = array.array(self.typecode, [42]*5)
self.assertEqual(a, array.array(self.typecode, [42,1,42,3,42,5,42,7,42,9]))
self.assertEqual(a, array.array(self.typecode, [42, 1, 42, 3, 42, 5, 42, 7, 42, 9]))
a = array.array(self.typecode, range(10))
a[::-4] = array.array(self.typecode, [10]*3)
self.assertEqual(a, array.array(self.typecode, [0,10,2,3,4,10,6,7,8,10]))
self.assertEqual(a, array.array(self.typecode, [0, 10, 2, 3, 4, 10, 6, 7, 8, 10]))
a = array.array(self.typecode, range(4))
a[::-1] = a
self.assertEqual(a, array.array(self.typecode, [3,2,1,0]))
self.assertEqual(a, array.array(self.typecode, [3, 2, 1, 0]))
a = array.array(self.typecode, range(10))
b = a[:]
c = a[:]
Expand Down Expand Up @@ -1346,7 +1345,6 @@ def check_overflow(self, lower, upper):

def test_subclassing(self):
typecode = self.typecode

class ExaggeratingArray(array.array):
__slots__ = ['offset']

Expand Down Expand Up @@ -1382,16 +1380,12 @@ def test_type_error(self):
class Intable:
def __init__(self, num):
self._num = num

def __index__(self):
return self._num

def __int__(self):
return self._num

def __sub__(self, other):
return Intable(int(self) - int(other))

def __add__(self, other):
return Intable(int(self) + int(other))

Expand Down
Loading