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

Accepting child class objects in base class type array #183

Closed
czgdp1807 opened this issue Mar 21, 2020 · 0 comments · Fixed by #197
Closed

Accepting child class objects in base class type array #183

czgdp1807 opened this issue Mar 21, 2020 · 0 comments · Fixed by #197

Comments

@czgdp1807
Copy link
Member

Description of the problem

Currently, arrays in arrays.py look for exact type match of elements before adding an element of the array using type. This approach is cryptic. Instead, _check_type should be used. See,

Well, the following suggests that type understands the class hierarchy but still it shouldn't be used,

>>> from pydatastructs import DynamicOneDimensionalArray as DODA
>>> from pydatastructs.linear_data_structures.arrays import DynamicArray as DA
>>> type(DA) == type(DODA)
True

Example of the problem

References/Other comments

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

Successfully merging a pull request may close this issue.

1 participant