Hacker News new | past | comments | ask | show | jobs | submit login

He is just demonstrating that __subclass__ hook has control over what is counted as a match.

Which he explained in another article that it allows the author of the abstract class to hijack calls to isinstance for any instances created from subclasses.




The point though is that the tone of his article seems to suggest that this is some scary "gotcha" of the language, whereas some of us consider this to just be the expected behavior.


Well to me the "gotcha" wasn't that you could control the match from the abstract class, it was all the silly things that you could do. Which for me was the point of the article. I mean the first palindrome example was pretty cool no?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: