Conventions and static typing

ulkis ulkis_blaffa at hotmail.com
Sat May 3 06:26:33 EDT 2003


I've been using Python for about a year, and I really like it.
However, there are a few of issues that bother me, and I'd like to
hear how other people look at, solve or work around them. I may not be
all that good at analyzing things, but here goes:

I think it all boils down to the dynamic typing of Python. Until a
couple of weeks ago I had never written a unit test, and believed that
static typing was a good help for reducing errors. After writing and
executing a couple of tests, that idea was crushed, as I realized that
static typing is as marginally useful and incomplete for error
removal, as DTD:s are for validating the contents of an XML doc (an
old pet peeve of mine).

But I know of at least one area where static typing is of great help,
and that is development tools. Anyone who has used Visual Studio,
JBuilder, Forte for Java, or any other reasonably modern Java or C++
IDE, knows how comfortable it is to have a list of available
parameters, members or other symbols, as well as documentation,
popping up automatically or at a keypress when typing source code. For
someone like me, with an almost diseasely bad memory, this is a great
aid. Due to the nature of Python (afaik), it would be very difficult
to make an IDE with such a feature working.

The alternative, which is the only one I know of when it comes to
Python, is to have the documentation handy. This is usually not a
problem, except that it often takes a lot more clicking or
button-pressing to find what you want. Also, this requires that the
documentation is good in content and format, which is not my
experience with Python-related 3:rd party libraries (e.g. Twisted,
wxPython, PyGame, pymqi).

So what do you people think of this. Am I the only one that see this
as a problem? Any suggestions for solutions?

Another point is, I belive, more related to convention than static
typing. When it comes to reusable components, Java has beans, and
Windows has OCX. A nice feature is that they have conventions for
exposing interface definitions that enable tools to interface to them
without knowing about them in advance. I am not aware of any such
conventions for Python, and introspection cannot (afaik) tell you much
about the parameters since what you may have, at best, is a default
value with a type, and in worst case **kwargs.

I have only used it very little, so this is just a guess, but doesn't
Boa constructor require built-in support for every kind of widget or
other component presented? So if I build a new widget, I can't just
add it to the palette and use it?

So once again, what do you think? If this is possible, then I just
have an ignorance gap to fill, which I look forward to. If not, should
it be, or should I change my way of thinking?


While a little longer that I had wished, I hope that this isn't taken
as a rant or troll - I am sincerely curious and want to make my Python
experience even more comfortable.




More information about the Python-list mailing list