More random python observations from a perl programmer

Aahz Maruch aahz at netcom.com
Thu Aug 19 14:40:38 EDT 1999


[please don't cc me if you follow up]

In article <37bc313b at cs.colorado.edu>,
Tom Christiansen  <tchrist at mox.perl.com> wrote:
>In comp.lang.python, 
>    Thomas Wouters <thomas at xs4all.nl> writes:
>:
>:Only if you aren't used to exceptions. Exceptions are really very simple and
>:nice things. Especially back when they were just strings (before my time, but
>:still ;-)
>
>No, I'm sorry, the expressivity of "break LABEL" and "continue LABEL"
>are much clearer than the cicumlocutions necessary for exceptions.
>That's like saying you can get the same effect by adding a bunch of lines
>of code.  That's not the same as built-in support, nor half so clear,
>nor half so convenient.  Isn't python about rapid prototyping and all?
>If it were about purity over convenience, I'm sure it would have been
>a lot different -- and completely unused.

OTOH, you can raise an exception and an arbitrary bit of code higher up
in the chain can catch it.  Which has good points and bad points; I
certainly won't claim that it discourages obscure code.

As a former perler, I would not say that Python is "about" rapid
prototyping; for me, even a "quick hack" in Python takes more planning
than the equivalent bit in Perl.  However, I do believe that Python
overall is *much* better suited for software engineering; I simply can't
imagine doing a multi-person project in Perl.

You neglected to mention IDLE and the command-line interpreter as a
Coolness, BTW.

>:> GOTCHA: (high)
>:>     Python has no manpages!  The horror!!!!!!!!!!!!!!!!!!!!!!
>:>     ENODOC
>:
>:Damn, i hadn't even noticed that. Can you imagine ? I guess the '__doc__'
>:attributes on objects are enough manpage for me. ;)
>
>It's unconscionable.   Lack of tools and the tool-based 
>approach strikes again.  See other postings.

That's one approach.  HTML, OTOH, leads to a navigation-based approach.
With Lynx as my primary browser, I feel that I get the best of both
worlds.

>:> QUESTION:
>:>     What is and what is not thread safe?
>:
>:Everything is thread safe. Or rather, there will at all times be only one
>:thread executing the Python interpreter.

This is incorrect.  See the docs for whrandom.

>Huh, no threads in python?

Yes, there are threads, but there is a global interpreter lock.
Anything that executes C code releases the lock (in general), so you get
significant parallelism if you're I/O heavy (for example), but not so
much if you're computationally intensive (in Python-only code).
--
                      --- Aahz (@netcom.com)

Androgynous poly kinky vanilla queer het    <*>      http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6  (if you want to know, do some research)




More information about the Python-list mailing list