PyDev:来自import的未定义变量:__name__ [英] PyDev: Undefined variable from import: __name__

查看:391
本文介绍了PyDev:来自import的未定义变量:__name__的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我经常在我的代码中使用类的 __ name __ 属性(在Python中完美运行),但 PyDev 始终将其标记为错误(来自导入的未定义变量)。

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).

我尝试将 __ name __ 添加到公告导入,但这并没有消除问题。

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

当我使用自动完成时,PyDev找到 __ class __ 属性在一个错误的类后面输入。但是如果我使用 __ class __ 属性,PyDev会找到 __ name __ 属性。

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.

PyDev中是否有与将类与实例化对象混合有关的错误?
有没有解决办法?

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

感谢您的帮助。

推荐答案

这是PyDev中的一个错误。请在PyDev sf跟踪器中报告。请参阅: http://pydev.org/about.html 获取链接。

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

这篇关于PyDev:来自import的未定义变量:__name__的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆