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

Add reference to the object missing an attribute to AttributeError #66905

Closed
flying-sheep mannequin opened this issue Oct 24, 2014 · 6 comments
Closed

Add reference to the object missing an attribute to AttributeError #66905

flying-sheep mannequin opened this issue Oct 24, 2014 · 6 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@flying-sheep
Copy link
Mannequin

flying-sheep mannequin commented Oct 24, 2014

BPO 22716
Nosy @ezio-melotti, @flying-sheep, @serhiy-storchaka
Files
  • attribute_error_origin.patch: Patch adding the origin of an AttributeError
  • 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 2014-11-02.16:08:54.111>
    created_at = <Date 2014-10-24.15:02:59.549>
    labels = ['interpreter-core', 'type-feature']
    title = 'Add reference to the object missing an attribute to AttributeError'
    updated_at = <Date 2014-11-02.16:31:27.537>
    user = 'https://github.com/flying-sheep'

    bugs.python.org fields:

    activity = <Date 2014-11-02.16:31:27.537>
    actor = 'flying sheep'
    assignee = 'none'
    closed = True
    closed_date = <Date 2014-11-02.16:08:54.111>
    closer = 'ezio.melotti'
    components = ['Interpreter Core']
    creation = <Date 2014-10-24.15:02:59.549>
    creator = 'flying sheep'
    dependencies = []
    files = ['37004']
    hgrepos = []
    issue_num = 22716
    keywords = ['patch']
    message_count = 6.0
    messages = ['229923', '229926', '230007', '230010', '230500', '230503']
    nosy_count = 3.0
    nosy_names = ['ezio.melotti', 'flying sheep', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue22716'
    versions = ['Python 3.5']

    @flying-sheep
    Copy link
    Mannequin Author

    flying-sheep mannequin commented Oct 24, 2014

    Trying to replicate a Ruby Gem that raises a “did you mean” error when mistyping a method name, I hit a showstopper:

    There seems to be no way to get the object which misses an attribute from an AttributeError.

    I propose the appended patch (it might be completely broken because I’m not experienced in the Python C API, but I tried)

    @flying-sheep flying-sheep mannequin added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement labels Oct 24, 2014
    @serhiy-storchaka
    Copy link
    Member

    This is a duplicate of bpo-18156.

    @flying-sheep
    Copy link
    Mannequin Author

    flying-sheep mannequin commented Oct 25, 2014

    No, this is about the object which misses an argument, not the attribute name.

    But thanks for the pointer: one combined fix for both would be the smartest thing to do.

    @flying-sheep flying-sheep mannequin reopened this Oct 25, 2014
    @serhiy-storchaka
    Copy link
    Member

    See also PEP-473.

    @ezio-melotti
    Copy link
    Member

    I think we should be pursued together with bpo-18156, so I'm going to close this. Serhiy already added a reference to this issue there.

    @flying-sheep
    Copy link
    Mannequin Author

    flying-sheep mannequin commented Nov 2, 2014

    sure, go ahead! i wasn’t aware of PEP nor issue, so sorry for filing a dupe.

    @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
    interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants