[issue46227] add pathlib.Path.walk method

2022-01-08 Thread Stanislav Zmiev
Stanislav Zmiev added the comment: Thanks for the tip! Hopefully, I created it correctly: https://discuss.python.org/t/add-pathlib-path-walk-method/ It is currently on review. -- ___ Python tracker <https://bugs.python.org/issue46

[issue46227] add pathlib.Path.walk method

2022-01-02 Thread Stanislav Zmiev
Change by Stanislav Zmiev : -- keywords: +patch pull_requests: +28552 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30340 ___ Python tracker <https://bugs.python.org/issu

[issue46227] add pathlib.Path.walk method

2022-01-02 Thread Stanislav Zmiev
Stanislav Zmiev added the comment: Some people could suggest using Path.glob instead but I found it to be less convenient for some use cases and generally slower (~2.7 times slower). >>> timeit("list(Path('Lib').walk())", number=100, globals=globals()) 1.90746401401702

[issue46227] add pathlib.Path.walk method

2022-01-02 Thread Stanislav Zmiev
New submission from Stanislav Zmiev : Pathlib is great, yet every time I have to parse a bunch of files, I have to use os.walk and join paths by hand. That's not a lot of code but I feel like pathlib should have higher-level abstractions for all path-related functionality of os. I propose we