which is best for a singleton, module or class?

Peter Bismuti peterb at cortland.com
Thu Nov 29 11:03:00 EST 2001


What is best for a singleton, making it a module or a class within a module?
I guess the reason why having a class within a module undesirable is that it
adds to the namespace of the object mymodule.mclass.property instead of
mymodule.property, and so fourth.  I know you can import it in a way to
reduce the path length of the object, but still, it seems like a cleaner
coding style to just use the module itself.   Opinions? THanks.





More information about the Python-list mailing list