From 82126901987f81e5300d57ea962e4555b0628dfb Mon Sep 17 00:00:00 2001 From: Tianyi Zheng Date: Tue, 15 Aug 2023 16:00:34 -0700 Subject: [PATCH] Update data_structures/binary_tree/binary_search_tree.py --- data_structures/binary_tree/binary_search_tree.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data_structures/binary_tree/binary_search_tree.py b/data_structures/binary_tree/binary_search_tree.py index 61e36b99e..a706d21e3 100644 --- a/data_structures/binary_tree/binary_search_tree.py +++ b/data_structures/binary_tree/binary_search_tree.py @@ -78,8 +78,8 @@ class Node: return pformat({f"{self.value}": (self.left, self.right)}, indent=1) @property - def is_right(self): - return self.parent and self is self.parent.right + def is_right(self) -> bool: + return self.parent is not None and self is self.parent.right class BinarySearchTree: