Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4933

MicroPython • late Imports and persistance of modules

$
0
0
I'm wondering how micropython handles RAM and whether it is worth 'just in time' imports and deleting modules when no longer required
(e.g. a Settings Menu display that requires a lot of text but only used once prior to normal use)

So if I use a late import :

Code:

def once_in_blue_moon(self,):import something ..
Does the mode 'something' get 'garbage collected' ? or is it persistent like a typical imported module? Do I need to specifically delete it?

Statistics: Posted by BillTodd — Sat Jan 27, 2024 1:02 pm



Viewing all articles
Browse latest Browse all 4933

Trending Articles