Re: Choose: class with static methods or module with functions

2009-04-17 Thread Dan Sommers
On Thu, 16 Apr 2009 09:55:40 -0700, bearophileHUGS wrote: > But there can be a situation where you want to keep functions even > closer, for example because in a module you have two classes and two > groups of functions related to each class. In such situation > staticmethods seem better. In orde

Re: Choose: class with static methods or module with functions

2009-04-16 Thread Chris Rebert
On Thu, Apr 16, 2009 at 9:55 AM, wrote: > Ravi: >> Which is a better approach. >> My personal view is that I should create a module with functions. > > When in doubt, use the simplest solution that works well enough. In > this case, module functions are simple and probably enough. > > But there c

Re: Choose: class with static methods or module with functions

2009-04-16 Thread bearophileHUGS
Ravi: > Which is a better approach. > My personal view is that I should create a module with functions. When in doubt, use the simplest solution that works well enough. In this case, module functions are simple and probably enough. But there can be a situation where you want to keep functions eve

Choose: class with static methods or module with functions

2009-04-16 Thread Ravi
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