[issue43213] Shortcut for checking if PurePath object contains str

2021-02-13 Thread Tomas Gustavsson
Tomas Gustavsson added the comment: Sorry Serhiy, missed your answer there. I understand your point. I guess I'll have to look for other things to help with :) Thank you for the answer. Guess this can be closed then. Best regards Tomas On Sat, 13 Feb 2021, 12:57 Serhiy Storchaka wrote

[issue43213] Shortcut for checking if PurePath object contains str

2021-02-13 Thread Tomas Gustavsson
Tomas Gustavsson added the comment: Okay, maybe a bad example. But let's say I want to find all folders and files but filter out those which contains .git,.svn in the paths. Anyhow, I believe this minor feature would make such use cases (and other) more clean and intuitive. I am lazy and I

[issue43213] Shortcut for checking if PurePath object contains str

2021-02-12 Thread Tomas Gustavsson
Change by Tomas Gustavsson : -- keywords: +patch Added file: https://bugs.python.org/file49806/pure_path_contains.patch ___ Python tracker <https://bugs.python.org/issue43

[issue43213] Shortcut for checking if PurePath object contains str

2021-02-12 Thread Tomas Gustavsson
New submission from Tomas Gustavsson : While using pathlib I realised there are situations where I easily want to check if part of a returned path object contains a particular given path (as a string). Today the following will give an error: ... path = PosixPath('/usr/share/doc/') if 'share