
On Sat, 19 Feb 2022 12:05:22 -0500 Larry Hastings <larry@hastings.org> wrote:
On 2/19/22 04:41, Antoine Pitrou wrote:
On Fri, 18 Feb 2022 14:56:10 -0700 Eric Snow<ericsnowcurrently@gmail.com> wrote:
On Wed, Feb 16, 2022 at 11:06 AM Larry Hastings<larry@hastings.org> wrote:
He suggested(*) all the constants unmarshalled as part of loading a module should be "immortal", and if we could rejigger how we allocated them to store them in their own memory pages, that would dovetail nicely with COW semantics, cutting down on the memory use of preforked server processes. Cool idea. I may mention it in the PEP as a possibility. Thanks! That is not so cool if for some reason an application routinely loads and unloads modules.
Do applications do that for some reason? Python module reloading is already so marginal, I thought hardly anybody did it.
I have no data point, but I would be surprised if there wasn't at least one example of such usage somewhere in the world, for example to hotload fixes in specific parts of an application without restarting it (or as part of a plugin / extension / mod system). There's also the auto-reload functionality in some Web servers or frameworks, but that is admittedly more of a development feature. Regards Antoine.