aptana报告python类型

2024-04-24 00:51:13 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用Aptana编写Python代码。Aptana经常报告错误,因为python中没有绑定到名称的类型信息。你知道吗

比如说:

class A:
    def __init__(self):
        self.m = None

class B:
    def __init__(self):
        pass
    def someMethod(self):
        pass

#in the main function 

a = A()
a.m = B()
a.m.someMethod() #Aptana will report a error here since it does not know a.m has such method.

类似的情况也存在。忽略它们不是什么大问题,但有没有一种优雅的方法可以避免这种情况?你知道吗


Tags: 代码inself名称noneinitdef报告