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 Torxed
Recipients Torxed
Date 2020-12-27.18:54:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I would like to propose that the `pathlib.Path()` gets a `in` operator, much like that ipaddress has IP in Subnet, it would be nice if we could be able to do:

import pathlib
pathlib.Path('/home/Torxed/machine.qcow2') in pathlib.Path('/home/Torxed')

Currently that would generate:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: argument of type 'PosixPath' is not iterable

This would avoid "complicated" implementations such as:

Which tend to be half-complete truths and would result in potential security issues. pathlib.Path() could help prevent some of those.
Date User Action Args
2020-12-27 18:54:36Torxedsetrecipients: + Torxed
2020-12-27 18:54:36Torxedsetmessageid: <>
2020-12-27 18:54:36Torxedlinkissue42758 messages
2020-12-27 18:54:36Torxedcreate