Skip to content

Commit 8034f13

Browse files
authored
Merge pull request #24 from OldemarCRC/patch-3
Update 1-objects-and-references.md
2 parents 62c911b + 0f415b4 commit 8034f13

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

data/part-9/1-objects-and-references.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ class Person:
934934
# NB: type hints must be enclosed in quotation marks if the parameter
935935
# is of the same type as the class itself!
936936
def older_than(self, another: "Person"):
937-
return self.year_of_birth < another.year_of_birth:
937+
return self.year_of_birth < another.year_of_birth
938938
```
939939

940940
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:

0 commit comments

Comments
 (0)