Choose: class with static methods or module with functions

Ravi ra.ravi.rav at gmail.com
Thu Apr 16 18:27:11 CEST 2009


I have to create a few helper/utility application-wide functions.
There are two options:

1. Create a Utility class and all functions as static method of that
class.

2. Create a module, utility.py and member functions.

Which is a better approach.

My personal view is that I should create a module with functions.
Classes are appropriate only when I am creating new types.



More information about the Python-list mailing list