On 14Sep2021 15:16, Guido van Rossum
Here I think we need to drop our perfectionist attitude. When I saw Marc-Andre's proposal my first response was also "but what about threads." But really, os.chdir() is the culprit here, and since it's a syscall we can't fix it. If we can live with that, we can live with the proposed os.workdir(). The docs just need a warning about threads. [...] If we don't offer this in the stdlib, users will just implement this themselves, poorly (for example, by not restoring the original when done).
Agreed here. As long as it has a big clear warning about process global
state.
That is the beauty of libraries, to me: not just reuse, but a correct
implementation is correct everywhere, and likewise a bugfix fixes all
the things.
Cheers,
Cameron Simpson