On Wed, Apr 7, 2010 at 1:19 AM, Jean-Michel Pichavant <
[email protected]> wrote:
> Usually, when using classes as namespace, functions are declared as static
> (or as classmethod if required).
> e.g.
>
>
> class Foo:
> @classmethod
> def process(cls, document):
> print 'process of'
> cls.foo(document)
>
> @staticmethod
> def foo(document):
> print document
>
> In [5]: Foo.process('my document')
> process of
> my document
>
>
> There is no more question about self, 'cause there is no more self. You
> don't need to create any instance of Foo neither.
JM, I beg to differ. If many functions are static inside a class, I would
simply put those methods right under a module instead.
My 2c,
Xav
--
http://mail.python.org/mailman/listinfo/python-list