Joshua Cannon <joshdcan...@gmail.com> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35498>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to