I am new to Python. I am attempting to match some data, although I need to "clean" the data before matching it.
I currently have 1 class for matching and one for cleaning.
When using the cleaning class in matching, should I use inheritance or class methods? Both will work but which is more 'pythonic'.
Option 1
import DataCleaner
class DataMatcher:
def clean(self):
self.name = DataCleaner.clean_name(self.name)
Options 2
import DataCleaner
class DataMatcher(DataCleaner):
def clean(self):
self.name = self.clean_name()