Eclipse pydev 自动建议在某些情况下不起作用 [英] Eclipse pydev auto-suggestions don't work in some cases
问题描述
我的问题可能很愚蠢,我希望有人成功解决了这个问题.
My question is probably stupid and I hope somebody has succeeded in solving this issue.
有时我无法在自动完成框中看到正确的建议(Eclipse 3.5.2、PyDev 1.5.7).例如:
Sometimes I cannot see right suggestions in auto-completion box (Eclipse 3.5.2, PyDev 1.5.7). For example:
import email
fp = open('my.eml', 'rb')
msg = email.message_from_file(fp)
msg
现在是一个 Message 对象.像 get_payload() 这样的函数工作正常.
msg
now is a Message object. And functions like get_payload() works fine.
msg.get_payload()
但我没有在自动完成列表中得到 get_payload()
.
But I don't get get_payload()
in auto-completion list.
我认为 PyDev 不知道 msg
是什么,所以它不知道要显示什么.
I think PyDev has no idea of what msg
is, so it doesn't know what to show.
也许我应该导入其他东西,而不仅仅是 email
模块?
Maybe I should import something else, not only email
module?
提前致谢!
推荐答案
很有可能,当前的 PyDev 构建还没有达到能够从函数中提取的程度 (message_from_file()
在您的情况下)了解它返回什么样的对象以提供自动完成提示.
Chances are, the current PyDev build hasn't gone to a point to be able to extract from a function (message_from_file()
in your case) to know what kind of object it returns in order to provide auto-completion hinting.
参见 http://sourceforge.net/projects/pydev/论坛/forum/293649/topic/3697707.
我相信 PyDev 有兴趣支持新的 Python 3 函数语法,PEP 3107
,它将解决您的一些问题......在未来.
I believe there is interest in PyDev to support the new Python 3 function syntax, PEP 3107
, which will solve some of your problems ... in the future.
这篇关于Eclipse pydev 自动建议在某些情况下不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!