Open tomprince opened 1 month ago
This is also related to #686.
Yes, this happens due to internal implementation reasons and the expected behavior is intentionally not specified, for implementation flexibility.
At this point enough people are relying on the ability to share variables across identically-named scripts on different servers that we probably can't/won't break that. The fact that we're doing it by code instead of filename is something we might change if needed in the future (although it seems unlikely).
I think it is weird enough behaviour that it would make sense to document it, even if there is a large caveat in the documentation that the behaviour is subject to change.
Given
I get the following surprising output.
I'd naively expect the output of each script to be
1
.This is perhaps desired, to avoid having scripts that are copied to every server taking up a bunch of memory, but it seems like it should be something that is at least documented.
This is somewhat related to #642, in that the lifetime and scope of module level variables are not what people might otherwise expect.