I'm a newby to python so please excuse the nomenclature stolen from other languages. I have a class containing a "static" attribute (a list) and a static method. I want to initialise the param to contain just a reference to the method:
class LogFilter(object):
@staticmethod
def _process_friendly_time(params):
# process params
pass
param_processors = [
LogFilter._process_friendly_time
]
# Later
for processor in LogFilter.param_processors:
processor(params)
This code causes an error
NameError: name 'LogFilter' is not defined`.
But if I replace LogFilter._process_friendly_time with just _process_friendly_time then I later get an error...
TypeError: 'staticmethod' object is not callable
Is there a syntax that will let me do this, or must I move the static method outside the class?