[issue40160] documentation example of os.walk should be less destructive

2020-05-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: 1. There is already a warning before example. 2. Even if you blindly copy-paste the example it will not work. You have to set the top variable. So I don't see any problem here. You always can shoot yourself in the foot if try enough. --

[issue40160] documentation example of os.walk should be less destructive

2020-05-23 Thread Kyle Stanley
Kyle Stanley added the comment: > I made the suggested change to just print the os.remove() statements (instead > of executing them) and also removed the 'skip news'. I think you may have misunderstood the suggestion. Specifically, the key part was "I would suggest adding succinct comments

[issue40160] documentation example of os.walk should be less destructive

2020-04-03 Thread John Taylor
John Taylor added the comment: I made the suggested change to just print the os.remove() statements (instead of executing them) and also removed the 'skip news'. -- ___ Python tracker

[issue40160] documentation example of os.walk should be less destructive

2020-04-03 Thread Kyle Stanley
Kyle Stanley added the comment: Serhiy Storchaka wrote: > I do not think there is clearer example of topdown=False than recursive > remove. > > If you think that this example is destructive, consider how destructive is > any possible example for shutil.rmtree()! I concur with Serhiy. If the

[issue40160] documentation example of os.walk should be less destructive

2020-04-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I do not think there is clearer example of topdown=False than recursive remove. If you think that this example is destructive, consider how destructive is any possible example for shutil.rmtree()! -- nosy: +serhiy.storchaka

[issue40160] documentation example of os.walk should be less destructive

2020-04-03 Thread Raymond Hettinger
Raymond Hettinger added the comment: One possibility is a gathering cumulative directory statistics that include totals from all descendants (i.e. how many bytes of files would you save by removing the directory with rm -rf). Outside of aggregating statistics, the normal reason to use

[issue40160] documentation example of os.walk should be less destructive

2020-04-03 Thread John Taylor
John Taylor added the comment: I would prefer an example that does not actually modify the file system. Is there any way this could be achieved, yet still demonstrate why topdown=False is necessary? -- ___ Python tracker

[issue40160] documentation example of os.walk should be less destructive

2020-04-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: The proposed replacement doesn't succeed in demonstrating why topdown=False is necessary. Consider doing a rename instead of a deletion or print. -- nosy: +rhettinger ___ Python tracker

[issue40160] documentation example of os.walk should be less destructive

2020-04-02 Thread John Taylor
John Taylor added the comment: https://github.com/python/cpython/pull/19313 I have just signed the CLA. -- ___ Python tracker ___

[issue40160] documentation example of os.walk should be less destructive

2020-04-02 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch nosy: +python-dev nosy_count: 2.0 -> 3.0 pull_requests: +18678 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19313 ___ Python tracker

[issue40160] documentation example of os.walk should be less destructive

2020-04-02 Thread John Taylor
New submission from John Taylor : The example for os.walkdir should be less destructive. It currently recursively removes all files and directories. I will be submitting a PR on GitHub. -- assignee: docs@python components: Documentation messages: 365625 nosy: docs@python, jftuga