On 2016-01-10, Peter Otten <__pete...@web.de> wrote:
>>>> class Derived(Base):
> ...     def _init(self, x):
> ...         super()._init(x)
> ...         print("do something else with", x)
> ... 
>>>> Derived(42)
> do something with 42
> do something else with 42
><__main__.Derived object at 0x7f8e6b3e9b70>
>

I think you are doing inheritance wrong.

AFAIK you should call directly the __init__() of the parent class, and
pass *args and **kwargs instead.

Except for that, yes, the _init would be conventionally private. Not
enforced by name mangling though.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to