Skip to content

Commit

Permalink
Updated object to class name (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
TarunTomar122 authored and czgdp1807 committed Dec 26, 2019
1 parent 15ab8ba commit a8e2a96
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pydatastructs/linear_data_structures/arrays.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def __new__(cls, dtype=NoneType, *args, **kwargs):
if dtype is NoneType or len(args) not in (1, 2):
raise ValueError("1D array cannot be created due to incorrect"
" information.")
obj = object.__new__(cls)
obj = Array.__new__(cls)
obj._dtype = dtype
if len(args) == 2:
if _check_type(args[0], list) and \
Expand Down
2 changes: 1 addition & 1 deletion pydatastructs/linear_data_structures/linked_lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class DoublyLinkedList(LinkedList):
__slots__ = ['head', 'tail', 'size']

def __new__(cls):
obj = object.__new__(cls)
obj = LinkedList.__new__(cls)
obj.head = None
obj.tail = None
obj.size = 0
Expand Down
4 changes: 2 additions & 2 deletions pydatastructs/trees/heaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Heap:
"""
pass

class BinaryHeap:
class BinaryHeap(Heap):
"""
Represents Binary Heap.
Expand Down Expand Up @@ -67,7 +67,7 @@ class BinaryHeap:
__slots__ = ['_comp', 'heap', 'heap_property', '_last_pos_filled']

def __new__(cls, elements=None, heap_property="min"):
obj = object.__new__(cls)
obj = Heap.__new__(cls)
obj.heap_property = heap_property
if heap_property == "min":
obj._comp = lambda key_parent, key_child: key_parent <= key_child
Expand Down

0 comments on commit a8e2a96

Please sign in to comment.