2012-04-03 9 views
0

私はPythonコードを書くためにAptanaを使用します。 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. 

同様のケースが存在します。それを無視するのは大きな問題ではありませんが、これを避けるためのエレガントな方法はありますか?

答えて