[issue36771] Feature Request: An option to os.walk() to return os.DirEntry lists instead of just filenames/dirnames

2019-05-06 Thread CJ Kucera
CJ Kucera added the comment: Will do, thanks for the input! -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue36771] Feature Request: An option to os.walk() to return os.DirEntry lists instead of just filenames/dirnames

2019-05-06 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: Thank you for your contribution but as discussed in this issue, we prefer to have a new function and not a new boolean flag. Here is my suggestions. * Create an other PR where you add a new function * Change the title of this issue. Thank you --

[issue36771] Feature Request: An option to os.walk() to return os.DirEntry lists instead of just filenames/dirnames

2019-05-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I concur with Stéphane. The boolean option for changing the type of the returned value is considered a bad design. -- ___ Python tracker

[issue36771] Feature Request: An option to os.walk() to return os.DirEntry lists instead of just filenames/dirnames

2019-05-06 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: I would like to have the advices of Serhiy. -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue36771] Feature Request: An option to os.walk() to return os.DirEntry lists instead of just filenames/dirnames

2019-05-06 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: And another solution, you could use the pathlib.Path class for your project. Have a nice day, -- ___ Python tracker ___

[issue36771] Feature Request: An option to os.walk() to return os.DirEntry lists instead of just filenames/dirnames

2019-05-01 Thread CJ Kucera
CJ Kucera added the comment: Yeah, I'd wondered that too (re: a separate function) but it seemed like an awful lot of duplicated code. The PR I'd put through just changes the datatypes within the `filenames` and `dirnames` lists... I'd been thinking that'd be sufficient since you wouldn't

[issue36771] Feature Request: An option to os.walk() to return os.DirEntry lists instead of just filenames/dirnames

2019-05-01 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: Hi, I think you have to create a new function and not to modify the current os.walk(), just because you change the type of the returned value. We have to avoid the inconsistency for the caller of os.walk(). is it a list of DirEntry or another list?

[issue36771] Feature Request: An option to os.walk() to return os.DirEntry lists instead of just filenames/dirnames

2019-05-01 Thread CJ Kucera
CJ Kucera added the comment: I've started up a Github PR for this, btw, though IMO it's not really in a mergeable state yet: 1) I wasn't sure what to do about os.fwalk(), since that *doesn't* already generate DirEntry objects, and this change would introduce a small inconsistency between

[issue36771] Feature Request: An option to os.walk() to return os.DirEntry lists instead of just filenames/dirnames

2019-05-01 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +12960 stage: -> patch review ___ Python tracker ___ ___

[issue36771] Feature Request: An option to os.walk() to return os.DirEntry lists instead of just filenames/dirnames

2019-05-01 Thread CJ Kucera
New submission from CJ Kucera : It'd be nice to have an option to os.walk which would return DirEntry objects in its return tuple, as opposed to just the string filenames/dirnames. (Or failing that, an alternate function which does so.) The function already uses os.scandir() internally, so