Skip to content

Updated object to class name #57 #63

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

Merged
merged 8 commits into from
Dec 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 == 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