This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author thejcannon
Recipients brett.cannon, mdk, serhiy.storchaka, thejcannon
Date 2019-09-13.13:43:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1568382193.3.0.814035018161.issue35498@roundup.psfhosted.org>
In-reply-to
Content
Pretty much the same reason you would want to slice any other sequence. You want some range of values.

top_most_3_dirs = myPath.parents[-3:]
grandparents_and_beyond = myPath.parents[1:]

The same goes for negative indexes.
History
Date User Action Args
2019-09-13 13:43:13thejcannonsetrecipients: + thejcannon, brett.cannon, serhiy.storchaka, mdk
2019-09-13 13:43:13thejcannonsetmessageid: <1568382193.3.0.814035018161.issue35498@roundup.psfhosted.org>
2019-09-13 13:43:13thejcannonlinkissue35498 messages
2019-09-13 13:43:13thejcannoncreate