A Lazy Loading Module
Here’s a Python challenge: I’ve got data. I use in many places. I only want to load it once. And I don’t want to load it until I need it. How can I make that slick?
Well, since Python 3.7, modules can have a __getattr__
function! Let’s create a module with attributes that only load when we access them.