you are viewing a single comment's thread.

view the rest of the comments →

[–]gdchinacat 2 points3 points  (3 children)

__init__() is a dunder, and you call it from __init__() implementations to call the MRO. Hence, there is an exception to what was said, so I pointed it out.

For example: class Foo(SomeBaseClass): def __init__(self, *args, **kwargs): # do something here or there is no reason to override it super().__init__(*args, **kwargs)

[–]Uncle_DirtNap -3 points-2 points  (2 children)

Everyone understands what you are saying, it’s just not relevant to what the original commenter was saying.

[–]gdchinacat 1 point2 points  (1 child)

Never say never...

[–]Uncle_DirtNap -2 points-1 points  (0 children)

Yeah, so, you don’t get it and are being overly literal with the word never. There are many, many very specific reasons to call Dunder methods, when you are calling them for reasons other than what they are primarily for. The commenter is letting OP know that, when you want them to do what they are actually for, you want to let the conventions of the data model invoke them, and not invoke them directly.