PEP 3107 and stronger typing (note: probably a newbie question)

Paddy paddy3118 at googlemail.com
Wed Jun 20 21:38:26 CEST 2007


On Jun 20, 7:53 pm, Stephen R Laniel <s... at laniels.org> wrote:
> Before I ask anything, let me note that this is surely an
> old question that has inspired its share of flame wars; I'm
> new to Python, but not new to how Internet discussions work.
> So if there's a canonical thread or web page that documents
> the whole battle, feel free to point me to it.
>
> Reading [1], I wonder: why isn't the compiler making better
> use of (purely optional) type labeling? Why not make a compiler
> directive so that
>
> a) it will check the types of all my arguments and return
>    values, and maybe even
> b) do some type inference up the call stack?
>
> E.g.,
>
> def( Class1 arg1, Class2 arg2, ..., ClassN argN ):
>     someStuff()
>
> would check the types of the arguments, whereas
>
> def( arg1, arg2, ..., argN):
>     someStuff()
>
> would not? I.e., if I *want* strong static
> type-checking, why shouldn't I be able to get it? Is it that
> allowing this as a compile-time option would mess up too
> many knobs to make it optional?
>
> Again, probably an old debate. I'd like to know why Guido's
> decided that not only is strong static typing
> productivity-reducing [2], but that it should be *forbidden*.
>
> [1] -http://www.python.org/dev/peps/pep-3107/
> [2] -http://www.artima.com/intv/strongweakP.html
>
> --
> Stephen R. Laniel
> s... at laniels.org
> Cell: +(617) 308-5571http://laniels.org/
> PGP key:http://laniels.org/slaniel.key

You have already raised hackles with the title of your post.
Python has very strog type checking already. It does not
have static type checking which may be what you meant.

It seems that if we want to have Python compile down to
machine code then we may have to confine names to
only refer to objects of one type. (as well as None).
I would prefer it if we weren't also required to
explicitly state the types of variable names.
The reasons are that I am not new to Python and prefer
the dynamism of names and the reliance on tests and
coverage over static type checking.

As you state that you are new to Python, why not try
the Python way;  gain proficiency; then think again
about the issue. If you are still of like mind then
your proficiency should enable you to give more
convincing reasons to the ccommunity.

- Paddy.


It would need support. Are you volunteering effort?





More information about the Python-list mailing list