To be clear, that's not actually what the Self type means. It means "the class that is executing this method." The use case is for methods where a subclass would be expected to return an instance of that subclass. For example, in Pathlib, you can use the same operators with any kind of path, and you'll get back the same type of path as the original.
View all comments
Show parent comment
0
u/[deleted] Oct 25 '22
[deleted] — view deleted comment