0
我使用Aptana編寫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.
類似的情況。忽視它們並不是一個大問題,但有沒有一種優雅的方法可以避免這種情況?