Improvement to imports, what is a better way ?

Cameron Simpson cs at cskk.id.au
Wed Jan 18 16:34:03 EST 2023


On 18Jan2023 12:57, Dan Kolis <dankolis at gmail.com> wrote:
>I'm not sure what to do. Do either / both know if there is a way to 
>make it parse each import list to bytecode in one shot ??

Python usually compiles files to bytecode and leaves those around as 
.pyc files to be used until the original source is modified. And anyway, 
an imported module is only loaded a ready once; imports are kept track 
of in the sys.modules dict, and just pulled directly from there when the 
same module is requests by another import.

>The hop around read keeps making me worry it migth leave some memory 
>leak or something.

I don't think you've described this. I don't know what you mean here.

Cheers,
Cameron Simpson <cs at cskk.id.au>


More information about the Python-list mailing list