Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested lambdas in setattr() lose context in Python 2.7 #73287

Closed
VictorLiu mannequin opened this issue Dec 29, 2016 · 2 comments
Closed

Nested lambdas in setattr() lose context in Python 2.7 #73287

VictorLiu mannequin opened this issue Dec 29, 2016 · 2 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@VictorLiu
Copy link
Mannequin

VictorLiu mannequin commented Dec 29, 2016

BPO 29101
Nosy @benjaminp
Files
  • bug.py
  • 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 = None
    closed_at = <Date 2016-12-29.04:25:25.583>
    created_at = <Date 2016-12-29.03:58:24.094>
    labels = ['type-bug', 'invalid']
    title = 'Nested lambdas in setattr() lose context in Python 2.7'
    updated_at = <Date 2016-12-29.04:25:25.581>
    user = 'https://bugs.python.org/VictorLiu'

    bugs.python.org fields:

    activity = <Date 2016-12-29.04:25:25.581>
    actor = 'benjamin.peterson'
    assignee = 'none'
    closed = True
    closed_date = <Date 2016-12-29.04:25:25.583>
    closer = 'benjamin.peterson'
    components = []
    creation = <Date 2016-12-29.03:58:24.094>
    creator = 'Victor Liu'
    dependencies = []
    files = ['46069']
    hgrepos = []
    issue_num = 29101
    keywords = []
    message_count = 2.0
    messages = ['284224', '284228']
    nosy_count = 2.0
    nosy_names = ['benjamin.peterson', 'Victor Liu']
    pr_nums = []
    priority = 'normal'
    resolution = 'not a bug'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue29101'
    versions = ['Python 2.7']

    @VictorLiu
    Copy link
    Mannequin Author

    VictorLiu mannequin commented Dec 29, 2016

    I would expect bug.py to output:
    foo
    bar
    baz

    but instead we observe:
    baz
    baz
    baz

    Replicated on Windows 10 Home Edition, Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)]

    @VictorLiu VictorLiu mannequin added the type-bug An unexpected behavior, bug, or error label Dec 29, 2016
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant