optional static typing for Python

Torsten Bronger bronger at physik.rwth-aachen.de
Mon Jan 28 06:54:12 EST 2008


Hallöchen!

Russ P. writes:

> On Jan 28, 1:51 am, Bruno Desthuilliers <bruno.
> 42.desthuilli... at wtf.websiteburo.oops.com> wrote:
>> Russ P. a écrit :> A while back I came across a tentative proposal from way
> back in 2000
>> > for optional static typing in Python:
>>
>> (snip)
>>
>>> In any case, optional static typing in Python would help
>>> tremendously here. The hardest part of automated conversion of
>>> Python to a statically typed language is the problem of type
>>> inference. If the types are explicitly declared, that problem
>>> obviously goes away.
>>
>> (snip)
>>
>>> Note also that, while "static" type checking would be ideal,
>>> "explicit" typing would be a major step in the right direction
>>
>> Lord have mercy(tm).
>
> What is that supposed to mean?

So you haven't understood him.  Then why is this rant following?

Anyway, I can only speak for myself: I have the concern that any
(albeit optional) declaring of types in Python leads to people
thinking that their code is more valuable with such declarations.
Mostly you know which type is to be expected after all.

As a result, you see such declarations everywhere, whether helpful
or not.  Maybe eventually tools such as pylint will even give a
percentage how many parameters are annotated, and people try to
maximize this value.  Ugh.

Then, Python is not as useful anymore because readability falls
drastically.  Moreover, there is a Fortran saying: "One person's
constant is another person's variable."  The same applies to types
in Python.

Pythons is one way, Ada another way; there is no silver bullet.

Tschö,
Torsten.

-- 
Torsten Bronger, aquisgrana, europa vetus
                                      Jabber ID: bronger at jabber.org
               (See http://ime.webhop.org for further contact info.)



More information about the Python-list mailing list