Strong typing implementation for Python

Michael Torrie torriem at gmail.com
Mon Oct 12 11:47:23 EDT 2015


On 10/12/2015 07:30 AM, Bartc wrote:
> On 12/10/2015 03:45, Michael Torrie wrote:
>> On 10/11/2015 06:34 PM, Steven D'Aprano wrote:
>>> That's called type inference, and there's nothing innovative about Swift to
>>> include that as a feature. Type inference is *old*. The theory behind type
>>> inference goes back to 1958, and languages such as ML and OCaml have
>>> included it for decades, and yet here we are in 2015 and people think that
>>> it's something cool and new :-(
>>
>> C++ introduced it a while ago (C++11), and D has had it from the
>> beginning.  Even lowly FreeBasic has it.
> 
> I've surprised Basic needs it. The last time I looked, $A was a string, 
> %B an integer, and C a number. Type inference wasn't hard!

Back in the day this was certainly true.  Most modern Basic dialects are
more C-like in their declarations.

> (And trying Freebasic, it insists on variables being declared anyway. 
> It's rather like C but with Basic syntax.)

FB could be considered C-like with a Basic syntax, yes, but with dynamic
strings and dynamic arrays.  This idea of being c-like makes FB kind of
interesting but uninteresting at the same time.  Kind of hard to come up
with a good reason to use it for something, especially when a dynamic
language like Python, combined with C, is so flexible.



More information about the Python-list mailing list