-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Closed as not planned
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-pathlibtype-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
Proposal:
Path
should be subscriptable so I can select components, e.g.
# Add a code block here, if required
In [5]: x = Path("hello/there/general/kenobi")
In [6]: x[0:1] == Path("hello/there")
# Returns true
(This is a more convenient alternative to .parts
, which returns a tuple of strings I have to reassemble into a path.)
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:
No response
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-pathlibtype-featureA feature request or enhancementA feature request or enhancement