GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — SymbolTable.get_identifiers() docstring return value incorrect · Issue #93660 · python/cpython

SymbolTable.get_identifiers() docstring return value incorrect #93660

New issue
Copy link
New issue
Copy link
Closed
Closed
SymbolTable.get_identifiers() docstring return value incorrect#93660
Copy link
Labels
docsDocumentation in the Doc dirDocumentation in the Doc direasy

Description

@pamelafox
pamelafox
opened on Jun 9, 2022
Issue body actions

Documentation

SymbolTable.get_identifiers() currently says:
"Return a list of names of symbols in this table."

However, the returned value is actually dict_keys, a dictionary view object, which doesn't support everything that a list does (notably, it's not subscriptable).

I have a PR with a proposed change incoming.

Activity

  1. pamelafox
    added
    docsDocumentation in the Doc dirDocumentation in the Doc dir
    on Jun 9, 2022
  2. pamelafox commented on Jun 9, 2022

    @pamelafox
    pamelafox
    on Jun 9, 2022
    ContributorAuthor
    More actions

    Alternatively, that method could return a list by wrapping the return value in list(), but that could potentially be backward incompatible so I assume its preferable to just update the documentation.

  3. hauntsaninja commented on Jun 10, 2022

    @hauntsaninja
    hauntsaninja
    on Jun 10, 2022
    Contributor
    More actions

    Thanks for spotting this! As an aside, looks like the type in typeshed is also incorrect, in case you feel like making another PR: https://github.com/python/typeshed/blob/ad48606a0d901d907f2428917d7a5f97959b4733/stdlib/symtable.pyi#L21 :-)

  4. kumaraditya303
    added
    easy
    on Jun 10, 2022
  5. pamelafox commented on Jun 10, 2022

    @pamelafox
    pamelafox
    on Jun 10, 2022
    ContributorAuthor
    More actions

    Sure, typeshed PR is here:
    python/typeshed#8054
    CPython PR is here:
    #93661

  6. AlexWaygood commented on Jun 11, 2022

    @AlexWaygood
    AlexWaygood
    on Jun 11, 2022
    Member
    More actions

    Fixed in:

    • gh-93660: Change list to view object in SymbolTable docstring #93661
    • [3.11] Change list to view object (GH-93661) #93722
    • [3.10] Change list to view object (GH-93661) #93723

    Thanks, @pamelafox!

  7. AlexWaygood
    closed this as completedon Jun 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dirDocumentation in the Doc direasy

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.