toxygen/toxygen/common/provider.py

14 lines
347 B
Python
Raw Normal View History

2024-02-13 21:00:45 +00:00
# -*- mode: python; indent-tabs-mode: nil; py-indent-offset: 4; coding: utf-8 -*-
2022-09-27 12:38:39 +00:00
class Provider:
def __init__(self, get_item_action):
self._get_item_action = get_item_action
self._item = None
def get_item(self):
if self._item is None:
self._item = self._get_item_action()
return self._item