我應該在班級中重新定義什麼特殊方法(s?),以便它處理AttributeError的例外情況並在這些情況下返回特殊值? 例如, >>> class MySpecialObject(AttributeErrorHandlingClass):
a = 5
b = 9
pass
>>>
>>> obj = MySpecialObject()
>>>
>>> o
我試圖做到這一點在我的計劃: dest = socket.gethostbyname(host)
我已經包含行: from socket import *
在文件的開頭。 我收到此錯誤: AttributeError: type object '_socketobject' has no attribute 'gethostbyname' 我運行Vista 64位。我的操作系統可能有問題嗎