A Python assertion checks a condition: execution continues when it is true, and raises an AssertionError when it is false. Unlike an expression, an assertion statement checks a condition rather than producing a value. section 2.1.2 section 2.1.3
Assertions can compare a function’s result with an expected value. For instances of a custom class, comparing their __dict__ representations can serve as a proxy for comparing the instances. section 13.3.1
assert create_task("Laundry,3").__dict__ == Task("Laundry", 3).__dict__
This assertion checks that create_task returns an instance with the expected attributes. section 13.3.1














