看板
[ Python ]
討論串[問題] 迭代物件中的所有非私有方法和欄位?
共 2 篇文章
首頁
上一頁
1
下一頁
尾頁
內容預覽:
最正規的答案是沒有辦法, 因為 Python 沒有在分.... 假設你有個 class 長這樣. class A:. def __init__(self):. self.x = 0. def f(self):. print('hi'). 你可能會想說 x 是屬性, f 是方法. 但事情並沒有這麼簡單
(還有752個字)
內容預覽:
python新手發問. 如題. 例如有個自定義物件. class A:. def __init__(self,a,b):. self.a=a. self.b=b. def doSome(self):. print(self.a). def doAnother(self):. print(self.b
(還有213個字)
首頁
上一頁
1
下一頁
尾頁