@@ -39,12 +39,9 @@ def not_specification(self):
39
39
40
40
41
41
class AndSpecification (CompositeSpecification ):
42
- _one = Specification ()
43
- _other = Specification ()
44
-
45
42
def __init__ (self , one , other ):
46
- self ._one = one
47
- self ._other = other
43
+ self ._one : Specification = one
44
+ self ._other : Specification = other
48
45
49
46
def is_satisfied_by (self , candidate ):
50
47
return bool (
@@ -54,12 +51,9 @@ def is_satisfied_by(self, candidate):
54
51
55
52
56
53
class OrSpecification (CompositeSpecification ):
57
- _one = Specification ()
58
- _other = Specification ()
59
-
60
54
def __init__ (self , one , other ):
61
- self ._one = one
62
- self ._other = other
55
+ self ._one : Specification = one
56
+ self ._other : Specification = other
63
57
64
58
def is_satisfied_by (self , candidate ):
65
59
return bool (
@@ -69,10 +63,8 @@ def is_satisfied_by(self, candidate):
69
63
70
64
71
65
class NotSpecification (CompositeSpecification ):
72
- _wrapped = Specification ()
73
-
74
66
def __init__ (self , wrapped ):
75
- self ._wrapped = wrapped
67
+ self ._wrapped : Specification = wrapped
76
68
77
69
def is_satisfied_by (self , candidate ):
78
70
return bool (not self ._wrapped .is_satisfied_by (candidate ))
0 commit comments