More random python observations from a perl programmer

Tom Christiansen tchrist at mox.perl.com
Thu Aug 19 19:30:51 CEST 1999


     [courtesy cc of this posting mailed to cited author]

In comp.lang.python, 
    Thomas Wouters <thomas at xs4all.nl> writes:
:It's an extension of Python's setup. Not everything is done to be immediately
:obvious, but everything is done to be _consistent_, and instantly obvious if
:you understand python. 

This is the goal.  It is not always reached.  There are plenty of 
oddities sticking out.

:&& and || are and and or.

I know that.  I asked why.

: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.

:There are 'raw' strings though, 'r"<string>"', that dont do backslashes.

Those aren't the book, and there are no manpages.  Therefore, 
in many ways, they don't really count.  I know it hurts to hear
this, and you're all going to jump on me, but please please think
about it for a bit before you do so.

:> 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.

:> 	>>> for c in ("weird", "bits"):
:> 	>>> for c in ("weird"):

:Wait, wait, you're doing two different things here. First off, you called
:'for' with different types of arguments, the first time with a tuple of
:strings, the second type with just a string. 

Oh, come now, you're telling me I'm expected to count the items
in the parens to know whether a split will happen.  Whatever. 
It's not obvious, so it's a real gotcha.  This is not consistent.

:But they are definately not the same :)

But they look the same, which is wicked.

:>>> import copy
:>>> print copy.__doc__

That's not a fricking manpage.  How can I run "apropos copy"
on it?  How do I do 

    grep copy /usr/python/man/*/*.*

or 

    find /usr/python/man -print | xargs grep copy /dev/null

or 

    troff -man /usr/python/man/man3/copy.3py

etc etc.  Tools, man.  Man tools.  Flexible interchangeable
parts.

:"Yes, the trailing comma counts" :)

Speaking of inconsistencies!

:
:> 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.

Huh, no threads in python?

--tom
-- 
"The past is the only dead thing that smells sweet."
				- Edward Thomas




More information about the Python-list mailing list