[issue42758] pathlib.Path to support the "in" operator (x in y)

Eric V. Smith report at bugs.python.org
Sun Dec 27 19:52:11 EST 2020


Eric V. Smith <eric at trueblade.com> added the comment:

Can you describe what this would do? How is it different from path.is_relative_to(other_path)?

>>> import pathlib
>>> pathlib.Path('/home/Torxed/machine.qcow2').is_relative_to(pathlib.Path('/home/Torxed'))
True

----------
nosy: +eric.smith

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42758>
_______________________________________


More information about the Python-bugs-list mailing list