Remove redundant type check in os.path.join()
#117636
Labels
performance
Performance or resource usage
stdlib
Python modules in the Lib dir
type-feature
A feature request or enhancement
Feature or enhancement
Proposal:
These type checks were introduced a long time ago in 5bfc03f and became redundant in 3f9183b with the addition of
os.fspath()
. They can be safely removed, slightly speeding upos.path.join()
in the process:I also noticed we're concatenating
b
to an empty string inposixpath.join()
in casepath
has a length of 0. Which we can fix quite easily:Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
os.path
#117610Linked PRs
os.path.join()
#117638The text was updated successfully, but these errors were encountered: