So the class I've created looks like this:
class DataProcessor(object):
data1
data2
data3
def process_data(self):
self.process_data1_inOneWay()
self.process_data2_inAnotherWay()
self.process_data3_inADifferentWay()
The processing task consists of parts and my question is: what is the proper place to define those helping functions. I don't feel like they should be part of the DataProcessor
class, because process_data
is the only method that uses them. I considered defining an inner class, but I read that their usage isn't really encouraged. I also considered lambdas, but rejected this idea due to their limited functionality. Or maybe I should put all the code inside process_data
method and don't split it into smaller parts.
I'd just put them into the class and give them a weak 'internal use' indicator.
According to PEP8 those method's names should have a leading underscore: _process_data1_someway()
.
As long as it is easily obvious what their role/intended visibility is just from reading the class definition, I would not worry too much about that.