Skip to content

symtable: get_namespace doesn't check whether if there are multiple namespaces or no namespaces at all #86521

Description

@isidentical
BPO 42355
Nosy @benjaminp, @isidentical
PRs
  • bpo-42355: symtable.get_namespace() now checks whether there are multiple or any namespaces found #23278
  • 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/isidentical'
    closed_at = <Date 2021-07-18.12:56:44.076>
    created_at = <Date 2020-11-14.10:27:36.184>
    labels = ['type-bug', 'library', '3.10']
    title = "symtable: get_namespace doesn't check whether if there are multiple namespaces or no namespaces at all"
    updated_at = <Date 2021-07-18.16:35:05.378>
    user = 'https://github.com/isidentical'

    bugs.python.org fields:

    activity = <Date 2021-07-18.16:35:05.378>
    actor = 'BTaskaya'
    assignee = 'BTaskaya'
    closed = True
    closed_date = <Date 2021-07-18.12:56:44.076>
    closer = 'BTaskaya'
    components = ['Library (Lib)']
    creation = <Date 2020-11-14.10:27:36.184>
    creator = 'BTaskaya'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 42355
    keywords = ['patch']
    message_count = 2.0
    messages = ['380969', '397748']
    nosy_count = 2.0
    nosy_names = ['benjamin.peterson', 'BTaskaya']
    pr_nums = ['23278']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue42355'
    versions = ['Python 3.10']

    Activity

    1. isidentical commented on Nov 14, 2020

      @isidentical
      SponsorMemberAuthor
      >>> table = symtable.symtable("A = 1", "<string>", "exec")
      >>> table.lookup("A")
      <symbol 'A'>
      >>> table.lookup("A").get_namespace()
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
        File "/usr/local/lib/python3.10/symtable.py", line 312, in get_namespace
          raise ValueError("name is bound to multiple namespaces")
      ValueError: name is bound to multiple namespaces
      >>> table.lookup("A").get_namespaces()
      ()
    2. self-assigned this
      on Nov 14, 2020
    3. added
      stdlibStandard Library Python modules in the Lib/ directory
      on Nov 14, 2020
    4. self-assigned this
      on Nov 14, 2020
    5. added
      stdlibStandard Library Python modules in the Lib/ directory
      on Nov 14, 2020
    6. isidentical commented on Jul 18, 2021

      @isidentical
      SponsorMemberAuthor

      New changeset a045991 by Batuhan Taskaya in branch 'main':
      bpo-42355: symtable.get_namespace() now checks whether there are multiple or any namespaces found (GH-23278)
      a045991

    7. added
      type-bugAn unexpected behavior, bug, or error
      and removed on Jul 18, 2021
    8. 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

    3.10 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions