forked from hofmannol/AlgoDatSoSe25
Renamed directories to use them as modules
Literal: Allowed compare with None
This commit is contained in:
parent
f0757f30fd
commit
78d4b25bd4
@ -21,6 +21,8 @@ class Literal:
|
|||||||
|
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
"""Vergleicht den Wert mit einem anderen Wert."""
|
"""Vergleicht den Wert mit einem anderen Wert."""
|
||||||
|
if other is None:
|
||||||
|
return False
|
||||||
assert isinstance(other, Literal), "Can only compare with Literal or MemoryCell"
|
assert isinstance(other, Literal), "Can only compare with Literal or MemoryCell"
|
||||||
self.compare_count += 1
|
self.compare_count += 1
|
||||||
self.read_count += 1
|
self.read_count += 1
|
||||||
@ -29,6 +31,8 @@ class Literal:
|
|||||||
|
|
||||||
def __ne__(self, other):
|
def __ne__(self, other):
|
||||||
"""Vergleicht den Wert der Speicherzelle mit einem anderen Wert."""
|
"""Vergleicht den Wert der Speicherzelle mit einem anderen Wert."""
|
||||||
|
if other is None:
|
||||||
|
return True
|
||||||
assert isinstance(other, Literal), "Can only compare with Literal or MemoryCell"
|
assert isinstance(other, Literal), "Can only compare with Literal or MemoryCell"
|
||||||
self.compare_count += 1
|
self.compare_count += 1
|
||||||
self.read_count += 1
|
self.read_count += 1
|
||||||
|
1
vorlesung/L05_binaere_baeume/__init__.py
Normal file
1
vorlesung/L05_binaere_baeume/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
from vorlesung.L05_binaere_baeume.bin_tree import BinaryTree
|
@ -1,4 +1,4 @@
|
|||||||
from bin_tree_node import BinaryTreeNode
|
from vorlesung.L05_binaere_baeume.bin_tree_node import BinaryTreeNode
|
||||||
from utils.project_dir import get_path
|
from utils.project_dir import get_path
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
0
vorlesung/__init__.py
Normal file
0
vorlesung/__init__.py
Normal file
Loading…
x
Reference in New Issue
Block a user