Skip to content

Commit a8e2a96

Browse files
TarunTomar122czgdp1807
authored andcommitted
Updated object to class name (#63)
1 parent 15ab8ba commit a8e2a96

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

pydatastructs/linear_data_structures/arrays.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def __new__(cls, dtype=NoneType, *args, **kwargs):
6969
if dtype is NoneType or len(args) not in (1, 2):
7070
raise ValueError("1D array cannot be created due to incorrect"
7171
" information.")
72-
obj = object.__new__(cls)
72+
obj = Array.__new__(cls)
7373
obj._dtype = dtype
7474
if len(args) == 2:
7575
if _check_type(args[0], list) and \

pydatastructs/linear_data_structures/linked_lists.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class DoublyLinkedList(LinkedList):
6161
__slots__ = ['head', 'tail', 'size']
6262

6363
def __new__(cls):
64-
obj = object.__new__(cls)
64+
obj = LinkedList.__new__(cls)
6565
obj.head = None
6666
obj.tail = None
6767
obj.size = 0

pydatastructs/trees/heaps.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Heap:
1111
"""
1212
pass
1313

14-
class BinaryHeap:
14+
class BinaryHeap(Heap):
1515
"""
1616
Represents Binary Heap.
1717
@@ -67,7 +67,7 @@ class BinaryHeap:
6767
__slots__ = ['_comp', 'heap', 'heap_property', '_last_pos_filled']
6868

6969
def __new__(cls, elements=None, heap_property="min"):
70-
obj = object.__new__(cls)
70+
obj = Heap.__new__(cls)
7171
obj.heap_property = heap_property
7272
if heap_property == "min":
7373
obj._comp = lambda key_parent, key_child: key_parent <= key_child

0 commit comments

Comments
 (0)