[issue26860] os.walk and os.fwalk yield namedtuple instead of tuple

2016-04-29 Thread Aviv Palivoda
Aviv Palivoda added the comment: Thanks for the response Ethan I think that I will leave the tests as they are in the current patch. > No doubt, there are exceptions to the rule in the standard library which is > less consistent than we might like: "stat_result". That said, stat_result >

[issue26860] os.walk and os.fwalk yield namedtuple instead of tuple

2016-04-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: https://www.python.org/dev/peps/pep-0008/#class-names -- "Class names should normally use the CapWords convention." Examples: - crypt.py 6:from collections import namedtuple as _namedtuple 13:class _Method(_namedtuple('_Method', 'name ident

[issue26860] os.walk and os.fwalk yield namedtuple instead of tuple

2016-04-29 Thread Ethan Furman
Ethan Furman added the comment: I'm not clear on what you asking, but regardless we should have both the old (by-index) tests and new by-attribute tests. -- ___ Python tracker

[issue26860] os.walk and os.fwalk yield namedtuple instead of tuple

2016-04-29 Thread Aviv Palivoda
Aviv Palivoda added the comment: In regard to Raymond`s points I agree with Serhiy`s comments. As for Serhiy`s doubts: > 3. Using namedtuple is slower and consumes more memory than using tuple. Even > for FS-related operation like os.walk() this can matter. A lot of code is > optimized for

[issue26860] os.walk and os.fwalk yield namedtuple instead of tuple

2016-04-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry, but I disagree with Raymond in many points. > Classes are normally named with CamelCase. Also, "walk_result" or > "WalkResult" seems like an odd name that doesn't really fit. DirEntry or > DirInfo is a better match (see the OP's example, "for

[issue26860] os.walk and os.fwalk yield namedtuple instead of tuple

2016-04-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: Classes are normally named with CamelCase. Also, "walk_result" or "WalkResult" seems like an odd name that doesn't really fit. DirEntry or DirInfo is a better match (see the OP's example, "for dir_entry in walk_it: ...") The "versionchanged" should be a

[issue26860] os.walk and os.fwalk yield namedtuple instead of tuple

2016-04-26 Thread Ethan Furman
Ethan Furman added the comment: Quick review of patch looks good. I'll try to look it over more closely later. -- ___ Python tracker ___

[issue26860] os.walk and os.fwalk yield namedtuple instead of tuple

2016-04-26 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker ___ ___

[issue26860] os.walk and os.fwalk yield namedtuple instead of tuple

2016-04-26 Thread Aviv Palivoda
New submission from Aviv Palivoda: I am suggesting that os.walk and os.fwalk will yield a namedtuple instead of the regular tuple they currently yield. The use case for this change can be seen in the next example: def walk_wrapper(walk_it): for dir_entry in walk_it: if dir_entry[0]