Menu

#1293 No auto-import option for operator.attrgetter

open
Editor (491)
5
2011-02-28
2011-02-28
No

Pydev 1.6.5 doesn't seem to recognize "attrgetter". I would expect it to suggest:

from operator import attrgetter

However, it doesn't. It also doesn't suggest an import for "itemgetter". I'm using python 2.6 on windows in Eclipse. Let me know if you need any more information.

Also, it looks like there's no group for 1.6.5 in the bug tracker.

Discussion

  • Fabio Zadrozny

    Fabio Zadrozny - 2011-02-28

    Actually,

    from operator import attrgetter

    is working for me here... Do you have some error in your error log? What's your OS? (see: http://pydev.org/faq.html#how_do_i_report_a_bug\)

    Cheers,

    Fabio

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2011-02-28
    • status: open --> pending
     
  • Leo Shklovskii

    Leo Shklovskii - 2011-02-28
    • status: pending --> open
     
  • Leo Shklovskii

    Leo Shklovskii - 2011-02-28

    Sorry, I may not have been clear. It's just that Pydev doesn't suggest the import correctly for me in the ctrl+1 menu.

    Here's what I'm seeing:
    http://img97.imageshack.us/img97/9872/attrgetter.png

    Once I manually write the import, Pydev recognizes it just fine. There are no messages in the error log. OS is win 7 SP1 x64

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2011-02-28

    The problem is that pydev only shows the ctrl+1 suggestions for modules which have source code (and operator is a builtin module without any sources).

    So, for now that's correct (although there are plans to improve that, so, leaving bug open).

    Cheers,

    Fabio

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2011-02-28
    • summary: Pydev doesn't recognize 'attrgetter' --> No auto-import option for operator.attrgetter