PyDev: Undefined variable from import: __name__

狂风中的少年 提交于 2019-12-10 19:36:35

问题


I use regularly the __name__ property of classes in my code (which works perfectly in Python) but PyDev is always marking it as an error (Undefined variable from import).

I tried to add the __name__ to the bulletin imports but this did not remove the problem.

When I use auto completion, PyDev finds a __class__ property when typing a . behind a class which is wrong. But if I use __class__ property anyway, PyDev finds the __name__ property.

Is there any bug in PyDev that has to do with mixing up classes with instanced objects? Is there any workaround?

Thanks for any help.


回答1:


It's a bug in PyDev. Please report that in the PyDev sf tracker. See: http://pydev.org/about.html for links.




回答2:


I just ran into this problem. After reading some forms on it, it looks like it's a problem with the console or kernel not loading fast-enough...

I just closed the document and re-opened it and all the errors went away.



来源:https://stackoverflow.com/questions/5831854/pydev-undefined-variable-from-import-name

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!