Tag

lazy property

1 views collected around this technical thread.

Python Programming Learning Circle
Python Programming Learning Circle
Mar 15, 2022 · Fundamentals

Implementing Lazy Properties in Python with Descriptors and @property

This article explains the concept of lazy initialization in Python, reviews the @property decorator, and provides two complete implementations—a descriptor class and a decorator function—to create lazy properties that compute a value only once and then cache it for subsequent accesses.

PerformanceTutorialdescriptor
0 likes · 5 min read
Implementing Lazy Properties in Python with Descriptors and @property