0

I am learning to make classes using template codes and one of them is coded with what looks like inheritance syntax:

class KNNLearner(object):

What is the purpose of (object) here?

sda
  • 27
  • 1
  • 5

1 Answers1

1

In python everything is an object, an object is an object. You can also create Meta-classes to change some behavior of your objects/object to implement something.

In you case KNNLearner(object) the (object) permits you to pass the class that you want to KNNLearner to inherit.

fefedo
  • 11
  • 4