HN user

MikeOnFire

-6 karma
Posts0
Comments7
View on HN
No posts found.

For each special method, you should show what syntax magically invokes it. Something like this:

foo.__iter__() is invoked by for x in foo a.__iadd__(b) is invoked by a += b a.__rmult__(b) is invoked by b * a when b * a fails. foo.__len__() is invoked by if foo when foo.__bool__ or foo.__nonzero__ is not defined. foo.__repr__() is invoked by '%r' % foo, also by pprint.pprint(foo) and deprecated `foo`. It's also invoked by __str__ magic when foo.__str__ is not defined. etc. Putting the above info in a table would also be helpful.

Why Finish Books? 14 years ago

I think the answer for this is different for fiction and non-fiction. If I don't finish a non-fiction book, I still sometimes consider it "read", if I have gotten the gest of it. This is especially true if the author goes into more detail towards the end of the book after making their point. Non-completed fiction books I usually don't recommend to friends.