summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pathlib/test_pathlib.py
diff options
context:
space:
mode:
authorBarney Gale <barney.gale@gmail.com>2024-09-02 16:14:09 (GMT)
committerGitHub <noreply@github.com>2024-09-02 16:14:09 (GMT)
commit5002f17794a9f403540305c733698d1e01699490 (patch)
treebcab059838634606c903922342de2c9603aa64b8 /Lib/test/test_pathlib/test_pathlib.py
parent77a2fb4bf1a1b160d6ce105508288fc77f636943 (diff)
downloadcpython-5002f17794a9f403540305c733698d1e01699490.zip
cpython-5002f17794a9f403540305c733698d1e01699490.tar.gz
cpython-5002f17794a9f403540305c733698d1e01699490.tar.bz2
GH-119518: Stop interning strings in pathlib GH-123356)
Remove `sys.intern(str(x))` calls when normalizing a path in pathlib. This speeds up `str(Path('foo/bar'))` by about 10%.
Diffstat (limited to 'Lib/test/test_pathlib/test_pathlib.py')
-rw-r--r--Lib/test/test_pathlib/test_pathlib.py9
1 files changed, 0 insertions, 9 deletions
diff --git a/Lib/test/test_pathlib/test_pathlib.py b/Lib/test/test_pathlib/test_pathlib.py
index f4449b1..b47b4a1 100644
--- a/Lib/test/test_pathlib/test_pathlib.py
+++ b/Lib/test/test_pathlib/test_pathlib.py
@@ -163,15 +163,6 @@ class PurePathTest(test_pathlib_abc.DummyPurePathTest):
# Special case for the empty path.
self._check_str('.', ('',))
- def test_parts_interning(self):
- P = self.cls
- p = P('/usr/bin/foo')
- q = P('/usr/local/bin')
- # 'usr'
- self.assertIs(p.parts[1], q.parts[1])
- # 'bin'
- self.assertIs(p.parts[2], q.parts[3])
-
def test_join_nested(self):
P = self.cls
p = P('a/b').joinpath(P('c'))