[Python-ideas] Adding "Typed" collections/iterators to Python

Devin Jeanpierre jeanpierreda at gmail.com
Wed Dec 21 01:51:43 CET 2011


> Not exactly true, and unnecessarily combative. More true is that careless
> use of 'typed' has gotten tiresome. Python is strongly dynamically typed.
> But people occasionally post -- again the same day you posted to python list
> -- that Python is weakly typed. I am tired of explaining that 'typed' is not
> synonymous with 'statically typed'.

I don't find this much less careless. How do you differentiate between
the "strong typing" of Python and the "strong typing" of Agda? It
isn't a binary quantity.

Perhaps, instead, we should stop claiming things are "strong" or
"weak". If I said that, relatively speaking, Python is weakly typed,
people would get offended -- not because I made any technically
incorrect statement (on the spectrum, Python is far closer to assembly
than Agda), but because to call it "weak" is insulting.

-- Devin

On Tue, Dec 20, 2011 at 6:01 PM, Terry Reedy <tjreedy at udel.edu> wrote:
> On 12/20/2011 1:50 PM, Nathan Rice wrote:
>
>> I put a module called "elementwise" on pypi
>> (http://pypi.python.org/pypi/elementwise/0.111220) that implements my
>> idea of what a nice broadcast proxy should do.
>
>
> I downloaded and took a brief look. I hope to get back to it later.
>
>
> 2.) there are serious dragons in
>>
>> how python handles complex inheritance graphs that result in
>> "object.__new__() takes no parameters", despite not having any builtin
>> bases and having no base class overriding __new__ or __init__
>
>
> Best not to use object as the apex of multiple inheritance.
>
>
>> Because "typed" is sort of a dirty word in the python community,
>
>
> Not exactly true, and unnecessarily combative. More true is that careless
> use of 'typed' has gotten tiresome. Python is strongly dynamically typed.
> But people occasionally post -- again the same day you posted to python list
> -- that Python is weakly typed. I am tired of explaining that 'typed' is not
> synonymous with 'statically typed'.
>
> Or consider your subject line. Python collections are typed both as to
> collection object and the contents. Python has narrow-content typed
> sequences. So just saying you want 'typed collections' does not say
> anything. We already have them. We even have propagation of narrow-content
> typing for operations on bytes and strings.
>
> But we do not have anything similar for numbers or user classes. And that
> might be worthwhile. So your subject seems more like 'adding generic
> narrowly typed sequences to Python'.
>
> --
> Terry Jan Reedy
>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas



More information about the Python-ideas mailing list