static python classes ?

Neil Cerutti horpner at yahoo.com
Wed Jun 20 12:03:01 EDT 2007


On 2007-06-20, Neil Cerutti <horpner at yahoo.com> wrote:
> On 2007-06-20, Alex Martelli <aleax at mac.com> wrote:
>> Neil Cerutti <horpner at yahoo.com> wrote:
>>> In C++ they are used most often for factory functions, since
>>> they conveniently have access to the class's private members,
>>> and don't want or need an existing instance. Python seems to
>>> have adopted this use-case (ConfigParser, for example), but
>>> without a need for it (code organization?).
>>
>> What staticmethod does ConfigParser have?  Can't recall one
>> offhand.
>
> I misremembered which module I had recently seen it in:

A quick search of the 2.5 Lib directory had the following
results. Only sqlite3 uses the staticmethod built-in function for
a family of conversion functions.

The other references to staticmethod were either tests of the
involving them, or introspection facilities that had to deal with
them.

-- 
Neil Cerutti



More information about the Python-list mailing list