[issue21748] glob.glob does not sort its results

2015-11-13 Thread Dave Jones
Dave Jones added the comment: As suggested, doc patch attached to new issue 25615. -- ___ Python tracker ___

[issue21748] glob.glob does not sort its results

2015-11-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There is nothing special with glob(). By default the ls command outputs sorted list of files, but os.listdir() doesn't. Python is just lower-level language than Posix shell. You always can call sort() on result. It is easy to just add sort() after calling

[issue21748] glob.glob does not sort its results

2015-11-13 Thread David Jones
David Jones added the comment: The original bug report did not mention ls (note serhiy.storchaka). It is a red herring. I accept that the Python community doesn't care to have glob.glob sorted. But then I think you should distance yourself from the shell in the documentation. It currently

[issue21748] glob.glob does not sort its results

2015-11-12 Thread Dave Jones
Dave Jones added the comment: >From the bash man-page: "... If one of these characters appears, then the word >is regarded as a pattern, and replaced with an *alphabetically sorted* list of >filenames matching the pattern". I would agree that glob.glob shouldn't sort its results (the overhead

[issue21748] glob.glob does not sort its results

2015-11-12 Thread Eric V. Smith
Eric V. Smith added the comment: Assuming David means "it wouldn't be unreasonable to insert a disclaimer", I agree. -- ___ Python tracker ___

[issue21748] glob.glob does not sort its results

2015-11-12 Thread R. David Murray
R. David Murray added the comment: You mean my old English teachers were wrong when they said a positive statement was to be preferred to a double negative? :) :) -- ___ Python tracker

[issue21748] glob.glob does not sort its results

2015-11-12 Thread R. David Murray
R. David Murray added the comment: Technically the docs are not wrong: "matches files according to the rules of the shell" does not say anything about sorting (matching is separate from what is done with the matched filenames; the shell sorts them and inserts them in place, python returns an

[issue21748] glob.glob does not sort its results

2015-11-12 Thread Eric V. Smith
Eric V. Smith added the comment: D'oh! I read your original comment as "it would be unreasonable to insert a disclaimer", and then I wondered why you'd used such a convoluted sentence and reversed your meaning. It's all my fault. Fortunately, I don't think Mrs. McKinley from 11th grade

[issue21748] glob.glob does not sort its results

2015-11-11 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- stage: -> resolved status: open -> closed ___ Python tracker ___

[issue21748] glob.glob does not sort its results

2014-06-14 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Actually iglob() can sort (per directory). But I don't think this is too needed feature. In any case you can sort result of glob(). -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org

[issue21748] glob.glob does not sort its results

2014-06-13 Thread David Jones
New submission from David Jones: ``` for f in glob.glob('input/*/*.dat'): print f ``` outputs: ``` input/ghcnm.v3.2.2.20140611/ghcnm.tavg.v3.2.2.20140611.qca.dat input/ghcnm.v3.2.2.20140506/ghcnm.tavg.v3.2.2.20140506.qca.dat ``` Note that these are not in the right order. Compare with shell

[issue21748] glob.glob does not sort its results

2014-06-13 Thread R. David Murray
R. David Murray added the comment: I think there is no reason to impose the overhead of a sort unless the user wants it...in which case they can sort it. I'm -1 on this change. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org

[issue21748] glob.glob does not sort its results

2014-06-13 Thread Jim Jewett
Jim Jewett added the comment: I agree with R. David Murray, but it may be worth adding a clarification sentence (or an example with sorted) to the documentation. Changing status to Pending, in hopes that any doc changes would be quick. -- nosy: +Jim.Jewett resolution: - not a bug

[issue21748] glob.glob does not sort its results

2014-06-13 Thread Eric V. Smith
Eric V. Smith added the comment: I agree that glob shouldn't sort. In addition, iglob definitely can't sort, and I don't think you want to have glob sort but iglob not sort. -- nosy: +eric.smith status: pending - open ___ Python tracker