convert property 'is_right' to one-liner

Also use 'is' instead of '=='

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
This commit is contained in:
isidroas 2023-08-14 20:39:50 +02:00 committed by GitHub
parent 2791958f9a
commit ba2efa2181
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,9 +79,7 @@ class Node:
@property
def is_right(self) -> bool:
if self.parent and self.parent.right:
return self == self.parent.right
return False
return self.parent and self is self.parent.right
class BinarySearchTree: