Maxwell Ballenger <balleng...@gmail.com> added the comment:

Use case: I want to see if a Path is a descendent of /tmp.

if filepath.parents[-2] == Path('tmp'):

turns into

if filepath.parents[len(filepath.parents)-2] == Path('tmp'):

----------
nosy: +maxballenger

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

Reply via email to