Menu ▾ ▴

Completion and import

2008-10-08
2013-03-15
  • Lukasz Byczynski

    Hi!

    I had problems with completion when I used import keyword this way:

    from datetime import datetime

    PyDev didn't complete and suggest any part of datetime class, but when I used import like this

    from date import *

    or

    import datetime

    code completion works perfectly ?? I'm trying develop good code and imports only needed methods. Not all namespace.

     
    • Fabio Zadrozny

      Fabio Zadrozny - 2008-10-09

      You're right... that's a bug!

      Please report it in the tracker: http://pydev.sourceforge.net/faq.html#how_do_i_report_a_bug

      Cheers,

      Fabio

       
    • yanfei liu

      yanfei liu - 2008-10-09

      Similar quesion:
      1) import MySQLdb
      :: code completion also did not work
      2) from xml.dom import minidom
      xmldoc=minidom.parse("\home\t.xml")
      :: xmldoc also cannot invoke code completion

      Can you give some suggestion.

       
      • Fabio Zadrozny

        Fabio Zadrozny - 2008-10-13

        Try adding MySQLdb and xml to your forced builtins: http://fabioz.com/pydev/manual_101_interpreter.html

        Cheers,

        Fabio

         
    • Chaim Krause

      Chaim Krause - 2008-10-17

      I wonder if my current issue is related. I am trying to work with nose. [1] I have even added nose to my forced buildins but I still can't see some methods. I believe it may because nose is probably a special case since it is just wrapping unittest methods and renaming them to be pythonic. For example, if I import nose or even from nose import * I cannot get any of the assert* methods to appear in code completion.

      [1] http://code.google.com/p/python-nose/

       
      • Fabio Zadrozny

        Fabio Zadrozny - 2008-10-17

        Have you tried adding 'nose' to the forced builtins? http://fabioz.com/pydev/manual_101_interpreter.html

        Cheers,

        Fabio

         
    • Chaim Krause

      Chaim Krause - 2008-10-18

      Fabio,

      Thanks for the reply.

      Yes, I have tried that, but it doesn't work completely.

      I have 'nose' added to the builtins, but if I attempt to use 'nose.tools.assert_equals()' it isn't found. I type 'assert_e' + Ctrl + Space and it doesn't show up. (Although related code from numpy shows up.).

      Now if I do an import in my module, it is found. For example, if I do 'from nose.tools import *'.

      Again I will mention that the methods in question are simply wrappers of others from unittest that are dynamically created by introspecting the unittest module. That is why my initial thought was that adding them to builtin would solve the problem.

      thanx