incomplete list of builtins?

2009-03-30
2013-03-15
  • Chad Dombrova

    Chad Dombrova - 2009-03-30

    I'm not sure my builtins are being properly populated in pydev preferences.  The instructions on this page http://fabioz.com/pydev/manual_101_interpreter.html state that I should have 50 builtin libs, but I only have those below:

    OpenGL
    __builtin__
    __main__
    _ast
    _codecs
    _sre
    _symtable
    _types
    email
    errno
    exceptions
    gc
    imp
    marshal
    os
    posix
    pwd
    signal
    sys
    thread
    wx
    wxPython
    xxsubtype
    zipimport

    at first I was not getting auto-completion on anything, but I re-setup the interpreter to point to the system install on leopard, and it seems that I'm getting auto-completion again.  I've tested these standard modules:

    string
    commands
    logging
    inspect
    re

    of these, 're' is the only module that does not provide auto-completion, so I'm not sure if I am broken or not.   I'd really like to know more about how this list of builtins is determined, and, more importantly, if my list is complete or not.

    while we're at it, how is the list of system python path directories determined when choosing the python binary for the interpreter?

    -chad

     
    • Ross Nicholson

      Ross Nicholson - 2009-03-31

      The re problem I can help you with, just add "re" to your list of forced builtins.

      I believe this is fixed for new configurations in the 1.4.5 release.

       
      • Chad Dombrova

        Chad Dombrova - 2009-03-31

        i have a clean copy that i just setup with eclipse 3.5M6 and pydev 1.4.5 and 're' is not part of the list, but this is really beside the point.  sure, i could solve my problem by manually adding every library in python to the builtins list, but for standard libs shouldn't pydev be determining this for me?  is this initial list just a hard-coded list maintained by pydev or is there an evaluation that determines which are builtins and which are not?   to put it as simply as I can: should I have more than 24 builtins in the list? 

        -chad

         
        • Fabio Zadrozny

          Fabio Zadrozny - 2009-04-01

          It should be the same list from:

          import sys
          print sys.builtin_module_names

          Some modules (such as 'email', 'wx') are hardcoded (because those modules are known to be better analyzed by a shell than by the static analyzer).

          So, that list depends largely on whether you're using python, jython, its version (or if it's some other custom interpreter)

          Cheers,

          Fabio