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

InternalError: astAssign.targets[0] is of type <class 'ast.Attribute'> #180

Closed
niallcm opened this issue Nov 15, 2024 · 3 comments · Fixed by #181
Closed

InternalError: astAssign.targets[0] is of type <class 'ast.Attribute'> #180

niallcm opened this issue Nov 15, 2024 · 3 comments · Fixed by #181

Comments

@niallcm
Copy link

niallcm commented Nov 15, 2024

Using pydoclint v0.5.9

pydoclint.utils.internal_error.InternalError: astAssign.targets[0] is of type <class 'ast.Attribute'>

The relevant code was adding an attribute to a method of a django ModelAdmin class:
image

Related to #151

@jsh9
Copy link
Owner

jsh9 commented Nov 26, 2024

I should have time to take a look this week.

@jsh9
Copy link
Owner

jsh9 commented Nov 26, 2024

Could you provide a reproducible example? Because I could not reproduce this issue with this file (something.py) with the following content:

class MyClass:
    def large_drawing(self, obj):
        return self.drawing(obj, size=500, center=False)

large_drawing.short_description = 'Drawing'

Thanks!

@jsh9
Copy link
Owner

jsh9 commented Nov 26, 2024

Never mind, I could reproduce with this code snippet instead:

class MyClass:
    def large_drawing(self, obj):
        return self.drawing(obj, size=500, center=False)

    large_drawing.short_description = 'Drawing'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants