__new__() does not return anything, on singletong pattern

Mario Figueiredo marfig at gmail.com
Thu Mar 12 04:10:24 EDT 2015


On Wed, 11 Mar 2015 16:47:32 -0700, Ethan Furman <ethan at stoneleaf.us>
wrote:
>
>You're code is good.  

Thanks for taking a weight off my shoulder.

>
> The only question is if you /really/ need a singleton -- and only
> you can answer that (although plenty of folks will tell you you
> don't ;) .

Yeah. I debated that myself. But in the end the singleton won.

It's just a cheap global, since is ubiquitous throughout the entire
application, does behave like a singleton, and is a bit too expensive
to create. A full map in the main application takes 3 or 4 seconds to
instantiate and occupies around 2 Mb of memory.


 



More information about the Python-list mailing list