From 0e866dc7c0eb3b1e29fe5ba569bd9a966fd4d414 Mon Sep 17 00:00:00 2001 From: Donne Martin Date: Wed, 20 Jul 2016 07:24:04 -0400 Subject: [PATCH] Update bst string representation method (#92) __repr__ is also used by __str__, but not vice versa. --- graphs_trees/bst/bst.py | 2 +- graphs_trees/bst/bst_solution.ipynb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/graphs_trees/bst/bst.py b/graphs_trees/bst/bst.py index e4a1d2b..877eeff 100644 --- a/graphs_trees/bst/bst.py +++ b/graphs_trees/bst/bst.py @@ -6,7 +6,7 @@ class Node(object): self.right = None self.parent = None - def __str__(self): + def __repr__(self): return str(self.data) diff --git a/graphs_trees/bst/bst_solution.ipynb b/graphs_trees/bst/bst_solution.ipynb index 8a092e4..d26aca5 100644 --- a/graphs_trees/bst/bst_solution.ipynb +++ b/graphs_trees/bst/bst_solution.ipynb @@ -123,7 +123,7 @@ " self.right = None\n", " self.parent = None\n", "\n", - " def __str__(self):\n", + " def __repr__(self):\n", " return str(self.data)\n", "\n", "\n",