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

[pylint] Avoid false-positive slot non-assignment for __dict__ (PLE0237) #10348

Merged
merged 1 commit into from Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -54,3 +54,15 @@ def __init__(self, name, middle_name):

def setup(self):
pass


class StudentF(object):
__slots__ = ("name", "__dict__")

def __init__(self, name, middle_name):
self.name = name
self.middle_name = middle_name # [assigning-non-slot]
self.setup()

def setup(self):
pass
Expand Up @@ -142,7 +142,7 @@ fn is_attributes_not_in_slots(body: &[Stmt]) -> Vec<AttributeAssignment> {
}
}

if slots.is_empty() {
if slots.is_empty() || slots.contains("__dict__") {
return vec![];
}

Expand Down