Hi Nicolas,

On Thu, Mar 02, 2006 at 01:55:03AM -0500, Nicolas Fleury wrote:
> (...)  A use case is not hard to 
> imagine, especially a private static method called only to build a class 
> attribute.

Uh.  I do this all the time, and the answer is simply: don't make that a
staticmethod.  Staticmethods are for the rare case where you need
dynamic class-based dispatch but don't have an instance around.

    class A:
        def _myinitializer():
            do strange stuff here
        _myinitializer()
        del _myinitializer   # optional


A bientot,

Armin
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to