Calling dunder methods manually

Chris Angelico rosuav at gmail.com
Thu Apr 13 04:58:48 EDT 2017


On Thu, Apr 13, 2017 at 4:18 PM, Rustom Mody <rustompmody at gmail.com> wrote:
> I believe it was ChrisA who gave a pithy summary of the situation:
> Dont CALL dunders
> But its fine to DEFINE them

As others have mentioned, you call dunders during the definitions of
dunders, mainly during subclassing. But from outside the class, you
generally shouldn't.

ChrisA


More information about the Python-list mailing list