-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documentation examples for
too-many-ancestors
(#7067)
Co-authored-by: Vladyslav Krylasov <[email protected]> Co-authored-by: Pierre Sassoulas <[email protected]>
- Loading branch information
1 parent
24aa4d2
commit 3c5eca2
Showing
3 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
class Animal: ... | ||
class BeakyAnimal(Animal): ... | ||
class FurryAnimal(Animal): ... | ||
class Swimmer(Animal): ... | ||
class EggLayer(Animal): ... | ||
class VenomousAnimal(Animal): ... | ||
class ProtectedSpecie(Animal): ... | ||
class BeaverTailedAnimal(Animal): ... | ||
class Vertebrate(Animal): ... | ||
|
||
|
||
# max of 7 by default, can be configured | ||
# each edge of a diamond inheritance counts | ||
class Playtypus( # [too-many-ancestors] | ||
BeakyAnimal, | ||
FurryAnimal, | ||
Swimmer, | ||
EggLayer, | ||
VenomousAnimal, | ||
ProtectedSpecie, | ||
BeaverTailedAnimal, | ||
Vertebrate, | ||
): | ||
pass |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,33 @@ | ||
# This is a placeholder for correct code for this message. | ||
class Animal: | ||
beaver_tailed: bool | ||
can_swim: bool | ||
has_beak: bool | ||
has_fur: bool | ||
has_vertebrae: bool | ||
lays_egg: bool | ||
protected_specie: bool | ||
venomous: bool | ||
|
||
|
||
class Invertebrate(Animal): | ||
has_vertebrae = False | ||
|
||
|
||
class Vertebrate(Animal): | ||
has_vertebrae = True | ||
|
||
|
||
class Mammal(Vertebrate): | ||
has_beak = False | ||
has_fur = True | ||
lays_egg = False | ||
venomous = False | ||
|
||
|
||
class Playtypus(Mammal): | ||
beaver_tailed = True | ||
can_swim = True | ||
has_beak = True | ||
lays_egg = False | ||
protected_specie = True | ||
venomous = True |