[issue32127] tutorial on dictionaries has error in example

2017-11-24 Thread Toby Berla

Toby Berla <toby.be...@gmail.com> added the comment:

Thanks, Eric. (I'm new to Python.) Perhaps I should have paid closer attention 
to the description of the dictionary data structure -- 

"Performing list(d.keys()) on a dictionary returns a list of all the keys used 
in the dictionary, in arbitrary order"

-- rather than just jumping ahead to the code example. ;-)

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32127>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32127] tutorial on dictionaries has error in example

2017-11-24 Thread Toby Berla

New submission from Toby Berla <toby.be...@gmail.com>:

in https://docs.python.org/3/tutorial/datastructures.html: 

-
5.5. Dictionaries
...
Here is a small example using a dictionary:

>>>
>>> tel = {'jack': 4098, 'sape': 4139}
>>> tel['guido'] = 4127
>>> tel
{'sape': 4139, 'guido': 4127, 'jack': 4098}
-

I think the order of dictionary elements shown after 'guido' is inserted is 
wrong.

The correct order is: 
{'jack': 4098, 'sape': 4139, 'guido': 4127}

--
assignee: docs@python
components: Documentation
messages: 306913
nosy: docs@python, tberla
priority: normal
severity: normal
status: open
title: tutorial on dictionaries has error in example
versions: Python 3.6

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32127>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com