Skip to content

Update 'how do I set a global variable' faq entry #51539

Description

@bitdancer
BPO 7290
Nosy @birkenfeld, @bitdancer
Files
  • UnboundLocalError-faq.patch
  • UnboundLocalError-faq.rst
  • 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 2009-11-10.19:00:32.392>
    created_at = <Date 2009-11-09.03:53:14.388>
    labels = ['type-feature', 'docs']
    title = "Update 'how do I set a global variable' faq entry"
    updated_at = <Date 2009-11-10.19:00:32.391>
    user = 'https://github.com/bitdancer'

    bugs.python.org fields:

    activity = <Date 2009-11-10.19:00:32.391>
    actor = 'r.david.murray'
    assignee = 'georg.brandl'
    closed = True
    closed_date = <Date 2009-11-10.19:00:32.392>
    closer = 'r.david.murray'
    components = ['Documentation']
    creation = <Date 2009-11-09.03:53:14.388>
    creator = 'r.david.murray'
    dependencies = []
    files = ['15294', '15295']
    hgrepos = []
    issue_num = 7290
    keywords = ['patch']
    message_count = 3.0
    messages = ['95057', '95106', '95128']
    nosy_count = 3.0
    nosy_names = ['georg.brandl', 'r.david.murray', 'olau']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue7290'
    versions = ['Python 2.6', 'Python 3.1', 'Python 2.7', 'Python 3.2']

    Activity

    1. bitdancer commented on Nov 9, 2009

      @bitdancer
      MemberAuthor

      Someone else closed bpo-7276, but I was thinking of doing so but
      wanted to include a pointer to the relevant documentation. I'm not sure
      where that documentation is, but I figured there ought to be a FAQ entry
      for it. And there is, sort of...the first two sections of the
      programming faq's 'core language' section. However, I think that the
      way that most people run in to this problem is by getting the
      'UnboundLocalError', and so I think the FAQ entry title should mention
      that error. I attach a proposed update to the first section of the core
      language section of the programming FAQ. I'm also going to attach a
      copy of the complete entry since it is hard to read in the patch.

    2. added
      docsDocumentation in the Doc dir
      type-featureA feature request or enhancement
      on Nov 9, 2009
    3. olau commented on Nov 10, 2009

      olaumannequin
      Mannequin

      As the reporter of bpo-7276, I think it's a clear explanation of this
      phenomonen. I think that maybe you should remove the "New Python
      programmers" in

      "New Python programmers are often surprised when they get this error in
      previously working code when they modify it by adding an assignment
      statement somewhere in the body of a function."

      so say something like

      "It can be a surprise to get this error in previously working code when it
      is modified by adding an assignment statement somewhere in a function
      body."

    4. bitdancer commented on Nov 10, 2009

      @bitdancer
      MemberAuthor

      Committed, with your suggested rewording, in r76190.

    5. 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 dirtype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions