New to Python: Features

Alex Martelli aleaxit at yahoo.com
Sat Oct 30 21:04:01 CEST 2004


<beliavsky at aol.com> wrote:
   ...
> you were using F77 compilers with the free format extension.

I guess I never met one without it -- funny!

> In some important ways Python does NOT trust the programmer, to his
> benefit.
> Trying to access an out-of-bound list element or using an
> uninitialized variable causes an immediate error.

Sure, just like dividing by zero or trying to divide a string by a list.
What's your point?  Diagnosing errors when requested an invalid
operation, rather than guessing at some default behavior to use instead,
has got nothing to do with 'not trusting' -- it has to do with 'errors
should never pass silently' and 'in the face of ambiguity refuse the
temptation to guess'.  C works very similarly if you try to multiply two
pointers by each other, or something equally invalid in that language.


> > indeed _increasing_ those characteristics, and dynamicity too.
> 
> I think "dynamism" is the word you are looking for :).

Actually I did mean dynamicity, even though dictionaries haven't picked
that word up yet.  Best definition I've found out of the many thousands
of Google hits for it is at:
http://creatingminds.org/tools/triz/principles/principle_15.htm .
It's not so much about _change_, which is the main current meaning of
"dynamism" ("continuous change, activity and progress", says one
dictionarym and that seems about right) -- it's about _forces_, how a
system is able to react to forces applied on it (both in the original
meaning in mechanics, and the obvious metaphorical applications in
systems theory, sociology, and programming).

 
> > and libraries in a huge variety of other languages, is crucial.  You
> > mentioned C++ and F95: I would not be surprised if the best _portable_
> > (across compilers and platforms) way of using both C++ and F95 in the
> > same program would be exactly to interface each of them to Python!-)
> 
> The Fortran 2003 standard mandates "interoperability" with C --
> Fortran calling C in a standardized way. Although it will be some time
> before full F2003 compilers exist, F95 vendors are adding high-demand
> features F2003 features such as C interoperability.

Bully for them -- and yet, that doesn't refute my hypothesis that, to
interface F95 with _C++_, which is specifically what I mentioned (as
opposed to C -- how comes you claimed that C is a strawman earlier, when
dissing it suited your crusade, and now it becomes a holy grail?-),
Python (with Boost Python and one of the Python/Fortran bridges) may the
best portable approach (no risk of hitting on a F95 compiler without
extensions taken from another standard, no need to write huge amount of
``extern "C" {'' boilerplate code on the C++ side of things, ...).


Alex



More information about the Python-list mailing list