OT: This Swift thing

Chris Angelico rosuav at gmail.com
Fri Jun 6 08:23:51 EDT 2014


On Fri, Jun 6, 2014 at 9:20 PM, Alain Ketterlin
<alain at dpt-info.u-strasbg.fr> wrote:
>> It's impossible to accidentally call a base class's method when you
>> ought to have called the overriding method in the subclass, which is a
>> risk in C++ [2].
>
> I don't how this can happen in C++, unless you actually have an instance
> of the base class. Anyway, I didn't mention C++.

Mostly if you forget to declare the method 'virtual'; there are other
ways to muck things up, but that's the main one.

ChrisA



More information about the Python-list mailing list