Core adjustments (typing, misc fixes, replacing os.path with pathlib.Path) #2293
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This builds up on #2292 (first commit is the same).
It's mostly just some general cleanup in typing, theoretical race conditions and removing os.path usage wherever possible within the core files.
I was considering replacing the leftover
import os
statements in core withfrom os import environ, getenv
and so on as that's mostly where it's still used but I've left those as is for now.There is no significant performance gain / loss, just some "going with the times" as I find os.path to be a bit antiquated, especially since this project is moving in the direction of no longer supporting older python versions anyways.
I don't mind this being dropped if you find it too risky or it collides with some other major overhaul that's in the works, just let me know with a comment and close the PR in that case.