Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

functools.cached_property objects in python

class DataSet:

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

    @cached_property
    def stdev(self):
        return statistics.stdev(self._data)
Source by docs.python.org #
 
PREVIOUS NEXT
Tagged: #objects #python
ADD COMMENT
Topic
Name
4+4 =