📌  相关文章
📜  这对于更好的 code.function 或 class 更好 - 无论代码示例

📅  最后修改于: 2022-03-11 15:00:08.896000             🧑  作者: Mango

代码示例1
class Person(object):
    def __init__(self, arg1, arg2):
        self.arg1 = arg1
        self.arg2 = arg2

    def compute(self, other):
        """ Example of bad class design, don't care about the result """
        return self.arg1 + self.arg2 % other
        
fuction thinks function is better,but probably class is everything.