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

2020-12-28 Thread Eric V. Smith
Eric V. Smith added the comment: I don't think there's any chance we'd add "in" as an alias for "is_relative_to()", so I'm going to close this. If you disagree, you could try and get support on python-ideas, and then we can re-open this. Thanks! -- resolution: -> rejected stage:

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

2020-12-28 Thread Anton Hvornum
Anton Hvornum added the comment: Missed that function, but they would behave the same without explicitly use the function call. -- ___ Python tracker ___

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

2020-12-27 Thread Eric V. Smith
Change by Eric V. Smith : -- versions: -Python 3.9 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

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

2020-12-27 Thread Eric V. Smith
Eric V. Smith 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 __

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

2020-12-27 Thread Anton Hvornum
New submission from Anton Hvornum : 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') pathlib.Path('/home/Torxed/machine.q