which version

  • Tim Diggins

    Tim Diggins - 2004-02-10

    Hi -

    I'm using version 0.2.8 which I got from CVS - is this a good version to be using (or should I just use the HEAD from CVS?)...

    Code completions with a module name (i.e. not the one you're editing) doesn't seem to work - only the module . Eg. type "os." and all you get are the "internal" names "mro", "__base__", etc.

    Is this a known issue, or a flaw with the way I've set up boa?

    many thanks.

    • Riaan Booysen

      Riaan Booysen - 2004-02-16

      You *are* using the HEAD from CVS ;)

      To get code completion for library modules you have to explicitly import the module first in the Boa Shell.

      Auto-importing arbitrary code is too dangerous.
      (Although this might change for standard lib modules at some stage)


      • Tim Diggins

        Tim Diggins - 2004-02-17

        Thanks for the info.

        And (after reading through the prefs) I notice I can use PYTHONSTARTUP environment variable to automatically run in the shell on startup. (then I can do a import os,sys,traceback, ... if I want to).

        I can see the concern with auto-importing arbitrary code (I had thought some parsing might be used to do the code completion) - but what about having preferences of which directories (in the python path) are allowed to be auto-imported. That would enable one to always have the standard library imported (and optionally one's own local extensions - if they are in a different directory on the python path), but have new or untested modules in a "sandbox"... I guess that's an RFE - maybe if I get familiar with boa internals at some point I'll see if I can make it work.

        anyway, thanks!

    • Riaan Booysen

      Riaan Booysen - 2004-02-17

      Hi Tim,

      Boa's code completion uses a combination of parsing (e.g. for the module you are currently working in) and introspection on imported modules (if it's already explicitly imported, why not use this info)

      I would love for the code completion to improve, but it's a really tricky thing to do properly.

      Once the parsing propagates to modules imported by other modules there will be real performance issues (which I don't want).


    • Tim Diggins

      Tim Diggins - 2004-02-21

      I've noticed an anomaly:

      if you have imported a module in the shell as follows into a different name, e.g:

      import modulename as modn

      then even if you import it identically in your own module in the explorer, you still can't get it to do code completion, unless you do something weird like:

        import modn
      except ImportError:
        import modname as modn

      in which case boa will grab the modn from the first import (which, when run, will fail - allowing you to do the correct import). however this is an egregious hack-workaround. It would be better if boa understood the "import .... as ...." construct.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks