<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 13 February 2014 20:00, Piet van Oostrum <span dir="ltr"><<a href="mailto:piet@vanoostrum.org" target="_blank">piet@vanoostrum.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ben Finney <<a href="mailto:ben%2Bpython@benfinney.id.au">ben+python@benfinney.id.au</a>> writes:<br>
<div class="">> Make that “somewhere” a module namespace, and you effectively have a<br></div><div class="">
> Singleton for all practical purposes. So yes, I see the point of it; but<br>
> we already have it built in :-)<br>
<br>
</div>There is a use case for a singleton class: when creating the singleton<br>
object takes considerable resources and you don't need it always in your<br>
program.<br></blockquote><div><br></div><div>Then have that resource in its own module, and import that module only when needed e.g. inside a function. Python already has the machinery - no need to reinvent the wheel.</div>
<div><br></div><div>Tim Delaney </div></div></div></div>