📜  python代码示例中的functools.cached_property对象

📅  最后修改于: 2022-03-11 14:46:53.841000             🧑  作者: Mango

代码示例1
class DataSet:

    def __init__(self, sequence_of_numbers):
        self._data = tuple(sequence_of_numbers)

    @cached_property
    def stdev(self):
        return statistics.stdev(self._data)