I need a namespace within a module for many different static methods doing similar jobs. From my research I learnt that having a class full of static methods is considered anti-pattern in Python programming:
class StatisticsBundle: @staticmethod def do_statistics1(params): pass @staticmethod def do_statistics2(params): pass If this isn't a good solution, what is the best practice instead that allows me to do a namespace lookup like getattr(SomeNameSpace, func_name) within the same module?
没有评论:
发表评论