My Python annoyances

Paul Boddie paul at boddie.org.uk
Thu May 3 10:27:11 EDT 2007


On 3 Mai, 15:49, Ben Collver <coll... at peak.org> wrote:
> I rewrote my code in Python and I found myself running into many of the
> same hassles that I run into with other languages: inaccurate and
> incomplete documentation, a maze of little platform-specific quirks to
> work around in the base classes, and a macho community of users.

I'm sorry to hear about that. If by "macho" you mean people who insist
that things are good enough as they are, and that newcomers should
themselves adapt to whatever they may discover, instead of things
being improved so that they are more intuitive and reliable for
newcomers and experienced developers alike, then I'd certainly be
interested in undermining that culture.

> The python web site recommended Dive Into Python, so I learned by
> reading that.  It has several examples that don't work because the
> Python base classes have changed behavior.  I should have taken that as
> lesson.

Really Dive Into Python should be a sufficient guide, and it was
perhaps the best introduction to the language when it was written. It
is very unfortunate that the language has changed in a number of ways
(and exhibits continued change) whilst effort into documenting what is
already there remains neglected amongst the people making all the
changes.

> I tried to write portable Python code.  The zlib CRC function returned
> different results on architectures between 32 bit and 64 bit
> architectures.  I filed a bug report.  It was closed, without a comment
> from the person who closed it.  I get the unspoken message: bug reports
> are not welcome.

Can you provide the bug identifier? Bug reports are generally welcome,
and despite complaints about patch reviews, I've found people
reviewing things I've submitted.

> I installed Cygwin on a Windows machine.  I try to quit from an
> interactive Python session.  It tells me that on my platform, I must
> press Control-Z to exit.  I press Control-Z and it makes Python a
> background process.

Yes, Ctrl-Z exits Python in the standard Windows edition. Since Cygwin
provides a POSIX-like environment, Ctrl-D should be used instead. If
the documentation is wrong, a bug report or patch should be filed
against the software.

> I tried to use the XML.minidom.  The documentation here is minimal as
> well.  So I read up on other web sites.  It turns out that the interface
> has changed quite a bit from the documentation I found on other web
> sites.  Where are the much loved docstrings?  In 2.3 minidom, they are
> sparse and cryptic.

I really don't know what to say about the PyXML/xmlcore situation. I
don't use ElementTree and hardly use PyXML or minidom, but something
really should have been done about the maintenance of the established
libraries rather than declaring them as legacy items and pretending
that they don't exist.

> Between 2.4 and 2.5, tempfile returns a different type of object.  My
> code cannot have a single test, it has check for type(obj) == file or
> obj.__class__ == tempfile._TemporaryFileWrapper.

Try using isinstance or relying on "deeper" knowledge of how the
object will be used.

> I decided to make a tkinter front-end for a Python program.  I decided
> to go with tkinter because it is included with many Python
> installations, so it maximizes the chance for my program to run out of
> the box.
>
> The tkinter documentation on the Python site mainly consists of loose
> notes and links to other sites.  The documentation on other sites is
> great, if you already know how to use tkinter.  I ran into bugs in
> TkAqua which make the grid layout unusable for me.  So I will need to
> ask potential users to install Xcode, X11, and mac ports, if they want
> to run my program.

Take a look at the python.org Wiki for links to other resources on
Tkinter:

http://wiki.python.org/moin/TkInter

Or consider other graphical frameworks:

http://wiki.python.org/moin/GuiProgramming

> In short, there is plenty of room for improvement.  Admittedly these are
> not problems with the language definition.  But I downloaded a Python
> distribution, and the problems are Python specific.

My opinions, already expressed, include the observation that the core
development community is more interested in extending the language
than in strengthening the standard library (and its documentation). It
should be noted that the proposed standard library reorganisation,
which is a very conservative affair, has actually been postponed until
after the release of Python 3.0a1 according to a message I read
recently. And yet, if you read people's lists about what they "hate"
about Python (amongst actual users of Python), guess which thing
almost always comes up?

http://www.google.com/search?q=%22things+I+hate+about+Python%22

Paul




More information about the Python-list mailing list