skipping __init__ and using exploiting a class member instead

Chris Angelico rosuav at gmail.com
Sun Oct 20 16:57:53 EDT 2013


On Mon, Oct 21, 2013 at 4:57 AM, Peter Cacioppi
<peter.cacioppi at gmail.com> wrote:
>>  You certainly don't have to write a constructor for a subclass in C++.
>
> Ahh, this message board is so collectively well informed (once you get past the trolls)
>
> The C++ project I worked on was religious about always overwriting parent class constructors. I had assumed this was because the language proper forbid it, but apparently it was just project protocol.

Minor point: In C++, you don't overwrite constructors; you simply add
your own. By the time a derived class's constructor is called, the
parents' have all already been called.

ChrisA



More information about the Python-list mailing list