Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: DynamicOneDimensionalArray's size is not updated properly #557

Open
Kishan-Ved opened this issue May 30, 2024 · 3 comments
Open

BUG: DynamicOneDimensionalArray's size is not updated properly #557

Kishan-Ved opened this issue May 30, 2024 · 3 comments

Comments

@Kishan-Ved
Copy link
Contributor

Description of the problem

BUG: DynamicOneDimensionalArray's size is not updated properly

Example of the problem

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.

@czgdp1807
Copy link
Member

What's the output given by len(A)?

@Kishan-Ved
Copy link
Contributor Author

It is the same as A.size for all the 3 cases in the code above.

@czgdp1807
Copy link
Member

Actually size is correct. len(A) should give 2 in the end. Also check the references in the DODA docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants