Skip to content

Commit 417e550

Browse files
Fitter: Make pylint happier
1 parent f6695ca commit 417e550

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Orange/modelling/base.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Fitter(Learner, metaclass=FitterMeta):
3030
learners.
3131
3232
"""
33-
__fits__ = None
33+
__fits__ = {}
3434
__returns__ = Model
3535

3636
# Constants to indicate what kind of problem we're dealing with
@@ -106,10 +106,9 @@ def supports_weights(self):
106106
"""The fitter supports weights if both the classification and
107107
regression learners support weights."""
108108
return (
109-
hasattr(self.get_learner(self.CLASSIFICATION), 'supports_weights')
110-
and self.get_learner(self.CLASSIFICATION).supports_weights) and (
111-
hasattr(self.get_learner(self.REGRESSION), 'supports_weights')
112-
and self.get_learner(self.REGRESSION).supports_weights)
109+
getattr(self.get_learner(self.CLASSIFICATION), 'supports_weights', False) and
110+
getattr(self.get_learner(self.REGRESSION), 'supports_weights', False)
111+
)
113112

114113
@property
115114
def params(self):

0 commit comments

Comments
 (0)