File tree Expand file tree Collapse file tree 1 file changed +4
-82
lines changed Expand file tree Collapse file tree 1 file changed +4
-82
lines changed Original file line number Diff line number Diff line change 11##Patterns: E0110
22
33import abc
4- import six
5- from abc import ABCMeta
6- from lala import Bala
7-
8-
9- @six .add_metaclass (abc .ABCMeta )
10- class GoodClass (object ):
11- pass
12-
13- @six .add_metaclass (abc .ABCMeta )
14- class SecondGoodClass (object ):
15- pass
16-
17- def test (self ):
18- """ do nothing. """
19-
20- @six .add_metaclass (abc .ABCMeta )
21- class ThirdGoodClass (object ):
22- pass
23-
24- def test (self ):
25- raise NotImplementedError ()
26-
27- @six .add_metaclass (abc .ABCMeta )
28- class FourthGoodClass (object ):
29- pass
30-
31- @six .add_metaclass (abc .ABCMeta )
32- class BadClass (object ):
33- pass
34-
35- @abc .abstractmethod
36- def test (self ):
37- """ do nothing. """
38-
39- @six .add_metaclass (abc .ABCMeta )
40- class SecondBadClass (object ):
41- pass
42-
43- @property
44- @abc .abstractmethod
45- def test (self ):
46- """ do nothing. """
47-
48- @six .add_metaclass (abc .ABCMeta )
49- class ThirdBadClass (object ):
50-
51- @abc .abstractmethod
52- def test (self ):
53- pass
54-
55-
56- class FourthBadClass (ThirdBadClass ):
57- pass
58-
59-
60- @six .add_metaclass (abc .ABCMeta )
61- class SomeMetaclass (object ):
62- pass
634
5+ class Animal (abc .ABC ):
646 @abc .abstractmethod
65- def prop (self ):
7+ def make_sound (self ):
668 pass
679
68-
69- class FifthGoodClass (SomeMetaclass ):
70- """Don't consider this abstract if some attributes are
71- there, but can't be inferred.
72- """
73- prop = Bala # missing
74-
75-
76- def main ():
77- """ do nothing """
78- GoodClass ()
79- SecondGoodClass ()
80- ThirdGoodClass ()
81- FourthGoodClass ()
82- ##Err: E0110
83- BadClass ()
84- ##Err: E0110
85- SecondBadClass ()
86- ##Err: E0110
87- ThirdBadClass ()
88- ##Err: E0110
89- FourthBadClass ()
10+ ##Err: E0110
11+ sheep = Animal ()
You can’t perform that action at this time.
0 commit comments