New to Python: Features

Carlos Ribeiro carribeiro at gmail.com
Tue Oct 5 09:23:34 EDT 2004


On Tue, 5 Oct 2004 14:33:52 +0200, Alex Martelli <aleaxit at yahoo.com> wrote:
> > > I was very used to workspaces back in the days of APL and I still miss
> > > them.  Why is it good not to have them?
> >
> > I've never used such a system so this is only second hand.
> > I recall hearing that in Smalltalk people end up customizing
> > an image, which makes is harder for different people to work
> > together on the same project.
> 
> As I recall, in IBM Research we tended to share a common workspace
> across one project, though each of us could and generally did have their
> own 'sandbox' workspace ``hived off'' the main one -- not very different
> from the situation with any typical CVS / SVN / etc - controlled project
> (though, if my memory serves, the workspace functionalities were skimpy
> compared to today's typical versioning systems -- in terms of branching,
> tagging, and other advanced stuff).  Imports/exports of sources for some
> part of the workspace were commonly used; few of us had at home either
> computers or terminals capable of good APL work (really needed a special
> keyboard...), so a typical way to work evenings or weekends without
> bothering to drive to the office would be to export some subtree of
> sources, print it out (with a good APL-capable printer;-), and work with
> a pencil on the printout.  Not very different from what one could do
> with file, really; but in addition the workspace automatically kept
> track of interactive sessions, with the ability to restart right from
> where you left off, and also to export enough source code
> _automatically_ to reconstruct the current situation somewhere else.

Now that you mention workspaces -- it took me a while to figure out
why I longed so much for a good IDE for Python, and the answer (in my
particular case) was not the glitzy GUI builder, but the ability to
stop/resume working on a project exactly as I left it. It's something
that I got used to in Delphi, so that was my main gripe then. But it's
**far** from a real workspace. The closest thing, in my experience,
and besides toy Scheme and Smalltalk projects, was the ability to save
sessions in X, but it was nothing to write home about -- it failed way
too often, and not all apps would support it. My current dream
scenario is to install VMWare, with the ability to 'freeze' the
virtual machine and resume working whenever I want, and to find
everything *exactly* where I left. That would be perfect.

But... interestingly enough, I'm having a few issues with persistence
in Python sessions that may (or not) show that workspaces do not work
as well in Python as they do in other environments. I may be the one
at fault here, but anyway...

I normally have a PythonWin window open, that I use to test small
blocks of code interactively. It's a 'workspace' of sorts -- it's
already instrumented with a few modules and convenience functions for
debugging. In some situations, I found that I can't just force the
reloading of modules that I've changed. In some cases, doing the
reload() trick just doesn't work (specially if another module that was
previously loaded, or executed, imports just a few names using from
<module> import <something>). I end up having to manually delete the
module from the sys.modules, or from some other namespace; in many
cases, I have to restart the entire Python session.

In essence -- and if I remember anything from my Smalltalk short
experience -- it's much easier maintain a consistent environment in
Smalltalk. It's partly due to the excellent class browser that is
integrated into the environment, but it's mainly due to the very way
the class hierachy is organized. It's always possible to know what
symbols are loaded; it's also easier to delete or redefine individual
symbols. PythonWin doesn't provide a class browser with the same level
of control, but I believe that the problem is deeper. For some reason,
I can never be sure if I've found all references to old modules or
symbols, and then I have to start a fresh session. It's something that
I'm still exploring, but for now, I have just to resort to frequent
Python session restarts just to make sure that all symbols are
'fresh'.


-- 
Carlos Ribeiro
Consultoria em Projetos
blog: http://rascunhosrotos.blogspot.com
blog: http://pythonnotes.blogspot.com
mail: carribeiro at gmail.com
mail: carribeiro at yahoo.com



More information about the Python-list mailing list