-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed
Labels
Description
When parsing and normalizing a path, pathlib calls sys.intern() on the string parts:
Line 273 in 96b392d
| parsed = [sys.intern(str(x)) for x in rel.split(sep) if x and x != '.'] |
I've never been able to establish that this is a worthwhile thing to do. The implementation seems incomplete, because the path normalization only occurs when a user manually initialises a path object, and not in paths generated from path.iterdir(), path.walk(), etc. Drives/roots/anchors aren't interned despite most likely to be shared.
Previous discussion: #112856 (comment)