Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Python

Name: Anonymous 2009-04-17 8:31

Whats the thing with import blah.blah.blah
Can't they just include it by default and use only the called functions? It is an interpreter. Not C++ where this is useful.

Name: Anonymous 2009-04-20 16:57

>>37

I don't know any Python or how it does it, but in the world of real compiled languages, I don't see how this statement is true:

because importing a module actually means executing its code

Loading a binary object, wether it be linking against it or loading it dynamically in memory, usually means simply that the module is loaded in memory, imports are resolved ( which may mean loading modules which it depends on, but aren't in memory (or linked) at the moment) and optionally executing an entrypoint(only true for dynamically loaded modules) or startup code. It's perfectly possible to have an imported module where you don't have to execute any of its code, for example someone could load a module which only contain resources and use them.

(P.S.: I'm someone else than who you're talking with.)

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List