01.05.20 01:23, Paul Ganssle пише:
class LazyList:
     def __init__(self, some_iterator):
         self._iter = some_iterator
         self._list = None

     @call_once
     def as_list(self):
         self._list = list(self._iter)
         return self._list

call_once is not applicable here, because it is only for functions which do not have arguments, but as_list() takes the self argument.
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/IQJJOO47QCZC5RFG42BPNGO43Z6VNHVR/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to