Open Kishan-Ved opened 1 month ago
BUG: DynamicOneDimensionalArray's size is not updated properly
def test_DynamicOneDimensionalArray3(): DODA = DynamicOneDimensionalArray A = DODA(int, 1) A.delete(1) print(A._size) print(str(A)) A.append(2) print(str(A)) print(A.size) A.append(3) print(str(A)) print(A.size)
Output:
1 [] ['2'] 1 ['2', '3'] 3
The final size should be 2, but it is 3.
What's the output given by len(A)?
len(A)
It is the same as A.size for all the 3 cases in the code above.
A.size
Actually size is correct. len(A) should give 2 in the end. Also check the references in the DODA docs.
size
2
DODA
Description of the problem
BUG: DynamicOneDimensionalArray's size is not updated properly
Example of the problem
Output:
The final size should be 2, but it is 3.