On 2/1/2015 12:45 PM, Chris Angelico wrote:
Simple answer: You write dunder methods and the interpreter calls
them. You don't call them yourself.

I can't currently think of any situation where it's appropriate to
call a dunder method manually (cue the swamping of such situations on
the list); you just call dir() or the + operator or whatever it be.

calling the parent dunder method from within the overiding new method comes to mind.

Emile


--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to