[issue8267] Tutorial secion on dictionary keys recommends sort instead of sorted

2010-03-30 Thread Kent Engström

New submission from Kent Engström :

The 2.[567] documentation recommends the use of the sort() method
to get a sorted list of dictionary keys. If would be less confusing
to new users if we recommended the sorted() functions instead.

The corresponding piece of Python 3 documentation already uses
the sorted() function.

--
assignee: georg.brandl
components: Documentation
files: dict.patch
keywords: patch
messages: 101953
nosy: georg.brandl, kent
severity: normal
status: open
title: Tutorial secion on dictionary keys recommends sort instead of sorted
versions: Python 2.5, Python 2.6, Python 2.7
Added file: http://bugs.python.org/file16699/dict.patch

___
Python tracker 
<http://bugs.python.org/issue8267>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8267] Tutorial section on dictionary keys recommends sort instead of sorted

2010-03-30 Thread Kent Engström

Changes by Kent Engström :


--
title: Tutorial secion on dictionary keys recommends sort instead of sorted -> 
Tutorial section on dictionary keys recommends sort instead of sorted

___
Python tracker 
<http://bugs.python.org/issue8267>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8267] Tutorial section on dictionary keys recommends sort instead of sorted

2010-04-02 Thread Kent Engström

Kent Engström  added the comment:

Is should have mentioned that we're discussion a section
of the tutorial concerned with dictionaries. It is not a
section on lists, sequences or sorting as such.

My colleague, who asked me for help after getting confused
by sort, was trying to loop over the keys in the dictionary
in sorted order.  In that context, sorted is superior to sort.

--

___
Python tracker 
<http://bugs.python.org/issue8267>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com