Skip to content

Commit

Permalink
Add example for duplicate-bases message documentation (#6083)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
  • Loading branch information
3 people authored Apr 1, 2022
1 parent c992072 commit 03a115e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
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

0 comments on commit 03a115e

Please sign in to comment.