Assigning result of a function call, where the function has no returnpylint(assignment-from-no-return)
我是Vscode 報這個錯,但可以正常運行。請教高手這是什么鬼?
附代碼:
class UserNameList:
_username_list = {}
@property
def users(self):
try:
with open('username_list.json', 'r') as f:
self._username_list = json.load(f)
return self._username_list
except Exception as e:
raise e
@users.setter
def users(self, arg):
try:
with open('username_list.json', 'w') as f:
self._username_list = json.dump(f, arg, ensure_ascii=False)
except Exception as e:
raise e
setter里的 self._username_list = json.dump(f, arg, ensure_ascii=False)報錯,self下面紅波浪。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/129626.html
