OT: This Swift thing

Alain Ketterlin alain at dpt-info.u-strasbg.fr
Fri Jun 6 07:20:05 EDT 2014


Chris Angelico <rosuav at gmail.com> writes:

> On Fri, Jun 6, 2014 at 7:23 AM, Mark Lawrence <breamoreboy at yahoo.co.uk> wrote:
>> On 05/06/2014 21:07, Alain Ketterlin wrote:
>>>
>>> Sturla Molden <sturla.molden at gmail.com> writes:
>>>
>>>> On 05/06/14 10:14, Alain Ketterlin wrote:
>>>>
>>>>> Type safety.
>>>>
>>>> Perhaps. Python has strong type safety.
>>>
>>> Come on.
>>
>> I don't understand that comment, please explain.
>
> "Type safety" means many different things to different people. What
> Python has is untyped variables, and hierarchically typed objects.
> It's impossible to accidentally treat an integer as a float, and have
> junk data [1].

It's impossible in Swift as well.

> 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++.

[I agree with the rest of your explanation.]

-- Alain.



More information about the Python-list mailing list