Skip to content
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 concepts/class-inheritance/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ In situations where only a small amount of functionality needs to be customized

`Inheritance` describes `is a kind of` relationship between two or more classes, abstracting common details into super (_base_ or _parent_) class and storing specific ones in the subclass (_derived class_ or _child class_).

To create a child class, specify the parent class name inside the pair of parenthesis, followed by it's name.
To create a child class, specify the parent class name inside the pair of parenthesis, followed by its name.
Example
```python
class Child(Parent):
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/tree-building/.meta/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def validate_record(record):
raise ValueError('Only root should have equal record and parent id.')

if not record.equal_id() and record.parent_id >= record.record_id:
raise ValueError("Node parent_id should be smaller than it's record_id.")
raise ValueError("Node parent_id should be smaller than its record_id.")


def BuildTree(records):
Expand Down
6 changes: 3 additions & 3 deletions exercises/practice/tree-building/tree_building_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def test_root_node_has_parent(self):
with self.assertRaises(ValueError) as err:
BuildTree(records)
self.assertEqual(type(err.exception), ValueError)
self.assertEqual(err.exception.args[0], "Node parent_id should be smaller than it's record_id.")
self.assertEqual(err.exception.args[0], "Node parent_id should be smaller than its record_id.")

def test_no_root_node(self):
records = [
Expand Down Expand Up @@ -167,7 +167,7 @@ def test_cycle_indirectly(self):
with self.assertRaises(ValueError) as err:
BuildTree(records)
self.assertEqual(type(err.exception), ValueError)
self.assertEqual(err.exception.args[0], "Node parent_id should be smaller than it's record_id.")
self.assertEqual(err.exception.args[0], "Node parent_id should be smaller than its record_id.")

def test_higher_id_parent_of_lower_id(self):
records = [
Expand All @@ -179,7 +179,7 @@ def test_higher_id_parent_of_lower_id(self):
with self.assertRaises(ValueError) as err:
BuildTree(records)
self.assertEqual(type(err.exception), ValueError)
self.assertEqual(err.exception.args[0], "Node parent_id should be smaller than it's record_id.")
self.assertEqual(err.exception.args[0], "Node parent_id should be smaller than its record_id.")

def assert_node_is_branch(self, node, node_id, children_count):
self.assertEqual(node.node_id, node_id)
Expand Down
Loading