2 ms·
There's another big difference between Python and C (and I don't know how Ruby does it): When a module is imported, the file is evaluated once, then stored in
by Izkata 3y ago
There's another big difference between Python and C (and I don't know how Ruby does it):
When a module is imported, the file is evaluated once, then stored in memory as a stateful object. Further imports of the same module, even from other files, reference the object in memory instead of evaluating the module again.
The dict used for this is accessible in sys.modules