Pydev不会解析动态创建的属性
||
问候,
我有一个奇怪的问题,我似乎无法解决:
我正在Windows XP上使用带有Eclipse Helios的pydev插件(如果有的话)。
我有一个包含一个类的模块。此类的“ 0”带有一个参数,该参数确定此类方法应具有的属性集。
由于不允许显示实际代码,因此可以给出以下类比:
class Car:
def __init__(self, attrs):
# attrs is a dictionary.
# the keys of attrs are the names of attributes that this car should have
# for example, a key of attr could be \'tires\'
# the values of attrs are the values of the attributes which are the keys
# so if the key is \'tires\', it\'s value might be 4
现在,由于我是在运行时动态设置这些变量的,所以当我这样做时,Pydev无法给我建议:
c = Car()
print c.tires
当我输入\“ c。\” +时,pydev不建议使用轮胎。
我如何才能获得此功能?还是pydev目前不能做的事情?
我将不胜感激
没有找到相关结果
已邀请:
2 个回复
良阑纠苫
在Car实例上设置了哪些属性。如果将类变量用于在ѭ0中设置的属性,则Pydev应该能够提供自动完成建议。
席陋临拈
这样,尽管在自动完成中仍建议使用所有属性的超集,但不会浪费内存。