Skip to content

Accepting child class objects in base class type array #183

Closed
@czgdp1807

Description

@czgdp1807

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions