Skip to content

Python 3 tutorial has old information about dicts #48906

Closed

Description

@mdcowles
mannequin
BPO 4656
Nosy @birkenfeld, @benjaminp

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/birkenfeld'
closed_at = <Date 2008-12-14.15:09:58.044>
created_at = <Date 2008-12-14.04:06:19.853>
labels = ['docs']
title = 'Python 3 tutorial has old information about dicts'
updated_at = <Date 2008-12-14.15:09:57.970>
user = 'https://bugs.python.org/mdcowles'

bugs.python.org fields:

activity = <Date 2008-12-14.15:09:57.970>
actor = 'benjamin.peterson'
assignee = 'georg.brandl'
closed = True
closed_date = <Date 2008-12-14.15:09:58.044>
closer = 'benjamin.peterson'
components = ['Documentation']
creation = <Date 2008-12-14.04:06:19.853>
creator = 'mdcowles'
dependencies = []
files = []
hgrepos = []
issue_num = 4656
keywords = []
message_count = 2.0
messages = ['77776', '77800']
nosy_count = 3.0
nosy_names = ['georg.brandl', 'mdcowles', 'benjamin.peterson']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue4656'
versions = ['Python 3.0']

Activity

  1. mdcowles commented on Dec 14, 2008

    mdcowlesmannequin
    MannequinAuthor

    [From a question sent to the python-help list.]

    In the Python 3 tutorial at:

    http://docs.python.org/3.0/tutorial/datastructures.html#dictionaries

    it says:

    The keys() method of a dictionary object returns a list of all the keys
    used in the dictionary, in arbitrary order if you want it sorted, just
    apply the sort() method to the list of keys

    But in What's New in Python 3.0 at:

    http://docs.python.org/3.0/whatsnew/3.0.html

    it says:

    dict methods dict.keys(), dict.items() and dict.values() return “views”
    instead of lists. For example, this no longer works: k = d.keys();
    k.sort(). Use k = sorted(d) instead

    I expect that it's just a matter of updating the tutorial.

  2. benjaminp commented on Dec 14, 2008

    @benjaminp
    Contributor

    Thanks! Fixed in r67755.

  3. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

docsDocumentation in the Doc dir

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions