From 0f415b49ff6d93f95ca976cf48a7ecd11ee48418 Mon Sep 17 00:00:00 2001 From: Jose Oldemar Chaves Urbina <72102769+OldemarCRC@users.noreply.github.com> Date: Tue, 11 Mar 2025 13:06:05 +0200 Subject: [PATCH] Update 1-objects-and-references.md There is a syntax error in the comparison at the end of the line, caused by the colon --- data/part-9/1-objects-and-references.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/part-9/1-objects-and-references.md b/data/part-9/1-objects-and-references.md index c9aa7ef1..1f82b569 100644 --- a/data/part-9/1-objects-and-references.md +++ b/data/part-9/1-objects-and-references.md @@ -934,7 +934,7 @@ class Person: # NB: type hints must be enclosed in quotation marks if the parameter # is of the same type as the class itself! def older_than(self, another: "Person"): - return self.year_of_birth < another.year_of_birth: + return self.year_of_birth < another.year_of_birth ``` As stated in the comments in the examples above, if the parameter in a method definition is of the same type as the class itself, the type hint must be enclosed in quotation marks. Leaving the quotation marks out causes an error, which you will see if you try the following: