[issue39705] Tutorial, 5.6 Looping Techniques, sorted() example

2020-05-17 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue39705] Tutorial, 5.6 Looping Techniques, sorted() example

2020-05-17 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset eefd4e04a2a1d3929d0f7978469e5b5c4e56 by Rahul Kumaresan in branch 'master': bpo-39705 : sorted() tutorial example under looping techniques improved (GH-18999)

[issue39705] Tutorial, 5.6 Looping Techniques, sorted() example

2020-03-14 Thread Rahul Kumaresan
Change by Rahul Kumaresan : -- keywords: +patch pull_requests: +18346 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18999 ___ Python tracker ___

[issue39705] Tutorial, 5.6 Looping Techniques, sorted() example

2020-02-25 Thread Rahul Kumaresan
Rahul Kumaresan added the comment: I would like to work on this documentation improvement task. Please help me understand if this is not being worked on already. -- nosy: +rahul-kumi ___ Python tracker

[issue39705] Tutorial, 5.6 Looping Techniques, sorted() example

2020-02-21 Thread Eric V. Smith
Eric V. Smith added the comment: That sounds like a good improvement, Raymond. -- ___ Python tracker ___ ___ Python-bugs-list

[issue39705] Tutorial, 5.6 Looping Techniques, sorted() example

2020-02-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: I prefer to keep the example as-is. It is an idiomatic way to loop over sets. The introductory text can be modified to explain that sets eliminate duplicates, that sets are ordered, and that sorted() puts them back in a deterministic order. --

[issue39705] Tutorial, 5.6 Looping Techniques, sorted() example

2020-02-21 Thread Eric V. Smith
Eric V. Smith added the comment: The code is converting to a set first, then calls sorted() on that set. So "apple" is removed when the set is created. I'm not sure the example should throw in creating a set while it's talking about sorting. -- nosy: +eric.smith

[issue39705] Tutorial, 5.6 Looping Techniques, sorted() example

2020-02-21 Thread Mirwi
New submission from Mirwi : >>> basket = ['apple', 'orange', 'apple', 'pear', 'orange', 'banana'] >>> for f in sorted(set(basket)): ... print(f) ... apple banana orange pear Shouldn't 'apple' appear two times as basket is a list that allows duplicates, not a set? I'm just doing my first