<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Borg with MetaClass ?</title>
	<atom:link href="http://www.larsen-b.com/Article/107.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.larsen-b.com/Article/107.html</link>
	<description>Titanium Exposé</description>
	<lastBuildDate>Mon, 02 Jul 2018 13:54:48 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5</generator>
	<item>
		<title>By: Ian Bicking</title>
		<link>http://www.larsen-b.com/Article/107.html/comment-page-1#comment-573</link>
		<dc:creator>Ian Bicking</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">#comment-573</guid>
		<description><![CDATA[__new__ allows you do fairly simply create a singleton.&#160; I think it goes like:&lt;br /&gt;
&lt;br /&gt;
def __new__(cls):&lt;br /&gt;
_ try:&lt;br /&gt;
_ _ return cls._singleton&lt;br /&gt;
_ except AttributeError:&lt;br /&gt;
_ _ s = cls._singleton = object.__new__(cls)&lt;br /&gt;
_ _ return s&lt;br /&gt;
&lt;br /&gt;
Or you can do:&lt;br /&gt;
&lt;br /&gt;
class _SingletonClass: ...&lt;br /&gt;
_TheSingleton = _SingletonClass&lt;br /&gt;
def SingletonClass():&lt;br /&gt;
_ return _TheSingleton&lt;br /&gt;
&lt;br /&gt;
The last one is my preferred solution ;)]]></description>
		<content:encoded><![CDATA[<p>__new__ allows you do fairly simply create a singleton.&nbsp; I think it goes like:</p>
<p>def __new__(cls):<br />
<br />
_ try:<br />
<br />
_ _ return cls._singleton<br />
<br />
_ except AttributeError:<br />
<br />
_ _ s = cls._singleton = object.__new__(cls)<br />
<br />
_ _ return s</p>
<p>Or you can do:</p>
<p>class _SingletonClass: &#8230;<br />
<br />
_TheSingleton = _SingletonClass<br />
<br />
def SingletonClass():<br />
<br />
_ return _TheSingleton</p>
<p>The last one is my preferred solution ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: phil</title>
		<link>http://www.larsen-b.com/Article/107.html/comment-page-1#comment-574</link>
		<dc:creator>phil</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">#comment-574</guid>
		<description><![CDATA[Have a look at: &lt;a href=&quot;http://c2.com/cgi/wiki?PythonSingleton&quot;&gt;http://c2.com/cgi/wiki?PythonSingleton&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
for many many Singleton Python Implementation (including one w/ metaclasses)]]></description>
		<content:encoded><![CDATA[<p>Have a look at: <a href="http://c2.com/cgi/wiki?PythonSingleton">http://c2.com/cgi/wiki?PythonSingleton</a></p>
<p>for many many Singleton Python Implementation (including one w/ metaclasses)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
