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 example for duplicate-bases message documentation #6083

Merged
merged 19 commits into from
Apr 1, 2022
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions doc/data/messages/d/duplicate-bases/bad.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class Animal:
pass


class Cat(Animal, Animal): # [duplicate-bases]
pass
10 changes: 10 additions & 0 deletions doc/data/messages/d/duplicate-bases/good.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class Animal:
pass


class Bird(Animal):
pass


class Cat(Animal):
pass
2 changes: 1 addition & 1 deletion pylint/checkers/classes/class_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ def _has_same_layout_slots(slots, assigned_value):
"E0241": (
"Duplicate bases for class %r",
"duplicate-bases",
"Used when a class has duplicate bases.",
"Duplicate use of base classes in derived classes raise TypeErrors.",
),
"E0242": (
"Value %r in slots conflicts with class variable",
Expand Down