a couple IDLE questions

Mark Hammond MHammond at skippinet.com.au
Wed Sep 8 18:45:20 EDT 1999


>    1.  It seems to ignore my PYTHONSTARTUP environment variable.  Any
>        particular reason why?

Pythonwin does too - it is far from clear that this would be a good idea.
People have often noticed this, but very few have asked for it to be
changed.  IMO, an IDLESTARTUP would be a better solution.

>    2.  I point the above variable at ~/.pythonrc.  When I open that file,
>        it doesn't colorize it, I suppose since it doesn't end in ".py".
Is
>        there a way to force it to treat a file as Python source when it
>        normally wouldn't (like, perhaps recognizing "-*- python -*-" like
>        Emacs does)?

Maybe, but really, is it worth the effort?  How many times do you need to
edit Python source that does not live in a .py/.pyw file?

>    3.  The class browser presents all classes and functions defined at the
>        top level of a module.  Should it perhaps be called a module
browser
>        and be expanded to present all objects defined at the module's
outer
>        scope?

I agree that "module browser" would be a better name.  Note that this uses
pyclbr, and this uses the Python parser module to build its information,
rather than importing the module.

IMO IDLE should grow an "object browser" as well as the existing one.  The
object browser could be used to look at any object, including a module.  By
using an instantiated object and using standard Python introspection you get
all this for free.  This is the approach Pythonwin takes.

>When I asked for the class browser on my .pythonrc file it generated a
>traceback

Well, dont do it then :-)  You must have a wicked .pythonrc file if you need
the browser to manage it :-)

I agree it should not present a traceback, but dont believe it worth the
effort to make these files browsable - it is simply not a Python module!

Mark.






More information about the Python-list mailing list