PythonWin IDE sucks!

Jason Cunliffe jasonic at nomadicsltd.com
Tue Oct 31 15:37:15 EST 2000


Glad you picked up on this, but frankly your example it has confused me a
little.
I hope you can clarify for me. it is one of those Python newbie gotchas I
really want to master:

Huaiyu Zhu <hzhu at users.sourceforge.net> wrote in message
news:slrn8vs1l1.2sc.hzhu at rocket.knowledgetrack.com...

> from module import object
> ...
> <hand edit module.py>
> ...
> import module               # only put old module in current space
> reload (module)             # module is new, but object still old
> from module import object   # now object is new as well.

...surely these are not the same?

>>> from module import object
puts 'object' directly into the namespace doesn't it, so one would use
>>> object

But in the second case

>>> import module

means that one would then use
>>> module.object

> It is easy to miss one or two of these during interactive session and get
> confused by new edits showing old behavior. (Import module only need to be
> done once per session.)
>
> Huaiyu

I suppose my question is:

When you use  >>> from module import object
#forget import module compeletely for the moment

how  do you do reload()?

It seems to me the cleanest way is to use the more verbose "import module"
syntax.
But there are many famous exceptions, such as wxPython Tutorials
http://www.wxpython.org/tut-part1.php

encourages
>>> from wxPython.wx import *

This certainly saves a lot of typing and mkaes for a cleare3r reading
standlone tutorial, but maybe be one of things which gets newbies in most
trouble.

So how does one clear and reload all of those objects?

My dumbo-pragmatic solution has always been to shrug saying "Damn namespace
pollution again!" and simply reboot PythonWin or IDLE whenever strange
!$#@%! stuff starts happening which I cannot explain. Not very satisfying -
but not the end of the world either :-()

Other packages which do the same I believe are PIL, mxDateTime

Thanks if anyone can shed some more light on this topic
- Jason
________________________________________________________________
Jason CUNLIFFE = NOMADICS['Interactive Art and Technology'].DesignDirector





More information about the Python-list mailing list