<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>t+1: Matt Wilson's blog</title>
	
	<link>http://blog.tplus1.com</link>
	<description>Economics, programming, life in Cleveland, parenting, growing vegetables, other stuff.</description>
	<pubDate>Thu, 20 Nov 2008 01:35:21 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<geo:lat>41.499202</geo:lat><geo:long>-81.554349</geo:long><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/tplus1/wtPt" type="application/rss+xml" /><feedburner:emailServiceId>1172407</feedburner:emailServiceId><feedburner:feedburnerHostname>http://www.feedburner.com</feedburner:feedburnerHostname><item>
		<title>New gmail themes are just enough to hook me again</title>
		<link>http://feeds.feedburner.com/~r/tplus1/wtPt/~3/459036752/</link>
		<comments>http://blog.tplus1.com/index.php/2008/11/19/new-gmail-themes-are-just-enough-to-hook-me-again/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 01:35:19 +0000</pubDate>
		<dc:creator>matt</dc:creator>
		
		<category><![CDATA[Google]]></category>

		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://blog.tplus1.com/?p=254</guid>
		<description><![CDATA[I&#8217;ve been thinking a lot lately about disconnecting from google.  Then they release gmail themes today.

I guess I&#8217;ll give them a few more months of my soul.
But seriously, if I knew how to search with mutt like I can search with gmail, gmail would get the boot.


<script type="text/javascript">
SHARETHIS.addEntry({
	title: "New gmail themes are just enough to hook me again",
	url: "http://blog.tplus1.com/index.php/2008/11/19/new-gmail-themes-are-just-enough-to-hook-me-again/"
});
</script>
	]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been thinking a lot lately about disconnecting from google.  Then they release gmail themes today.</p>
<p><a href='http://blog.tplus1.com/index.php/2008/11/19/new-gmail-themes-are-just-enough-to-hook-me-again/gmail-terminal/' rel="attachment wp-att-255"><img src="http://blog.tplus1.com/wp-content/uploads/2008/11/gmail-terminal.png" alt="gmail with terminal theme" title="gmail-terminal" width="499" height="375" class="alignnone size-full wp-image-255" /></a></p>
<p>I guess I&#8217;ll give them a few more months of my soul.</p>
<p>But seriously, if I knew how to search with mutt like I can search with gmail, gmail would get the boot.</p>
<p><a href="http://sharethis.com/item?publisher=4bc7005e-aa8c-421e-a726-24badd341a96&title=New+gmail+themes+are+just+enough+to+hook+me+again&url=http%3A%2F%2Fblog.tplus1.com%2Findex.php%2F2008%2F11%2F19%2Fnew-gmail-themes-are-just-enough-to-hook-me-again%2F">ShareThis</a></p>
<p><a href="http://feeds.feedburner.com/~a/tplus1/wtPt?a=4qrEhn"><img src="http://feeds.feedburner.com/~a/tplus1/wtPt?i=4qrEhn" border="0"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.tplus1.com/index.php/2008/11/19/new-gmail-themes-are-just-enough-to-hook-me-again/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.tplus1.com/index.php/2008/11/19/new-gmail-themes-are-just-enough-to-hook-me-again/</feedburner:origLink></item>
		<item>
		<title>Got back from PyWorks</title>
		<link>http://feeds.feedburner.com/~r/tplus1/wtPt/~3/455314909/</link>
		<comments>http://blog.tplus1.com/index.php/2008/11/16/got-back-from-pyworks/#comments</comments>
		<pubDate>Sun, 16 Nov 2008 22:20:53 +0000</pubDate>
		<dc:creator>matt</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://blog.tplus1.com/?p=253</guid>
		<description><![CDATA[PyWorks was a lot of fun.
Mark Ramm did a talk about WSGI where in one slide he showed how to build up something akin to the full Pylons stack by just applying lots of WSGI middlewares.  That really inspired me.  Sure, frameworks are great, but I think I&#8217;m going to try to going [...]

<script type="text/javascript">
SHARETHIS.addEntry({
	title: "Got back from PyWorks",
	url: "http://blog.tplus1.com/index.php/2008/11/16/got-back-from-pyworks/"
});
</script>
	]]></description>
			<content:encoded><![CDATA[<p><a href="http://pyworks.mtacon.com">PyWorks</a> was a lot of fun.</p>
<p><a href="http://compoundthinking.com">Mark Ramm</a> did a talk about WSGI where in one slide he showed how to build up something akin to the full Pylons stack by just applying lots of WSGI middlewares.  That really inspired me.  Sure, frameworks are great, but I think I&#8217;m going to try to going to the opposite extreme for a while &#8212; building up from components, rather than using somebody else&#8217;s aggregation of components.</p>
<p>Based on a few hallway conversations, It turns out I&#8217;m not the only one using version control as a way to deploy code in production.  My production box runs a git clone of my production branch.</p>
<p><a href="http://jonebird.com/">jonEbird</a> did a talk on using LDAP with Python.  It was the first time I had realized that LDAP can do more than user authentication.</p>
<p>I liked <a href="http://maintainablesoftware.com/">Mike Naberezny&#8217;s</a> talk on routes also.  Good introduction.  It reaffirmed my idea that it&#8217;s not going to be all that difficult to string a bunch of stuff together for my next web app.</p>
<p><a href="http://www.percious.com/blog/">Chris Perkins</a> showed some neat TDD / agile programming techniques possible and made SQLAlchemy seem much friendlier than when I looked at it last year.</p>
<p><a href="http://sharethis.com/item?publisher=4bc7005e-aa8c-421e-a726-24badd341a96&title=Got+back+from+PyWorks&url=http%3A%2F%2Fblog.tplus1.com%2Findex.php%2F2008%2F11%2F16%2Fgot-back-from-pyworks%2F">ShareThis</a></p>
<p><a href="http://feeds.feedburner.com/~a/tplus1/wtPt?a=3zuN33"><img src="http://feeds.feedburner.com/~a/tplus1/wtPt?i=3zuN33" border="0"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.tplus1.com/index.php/2008/11/16/got-back-from-pyworks/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.tplus1.com/index.php/2008/11/16/got-back-from-pyworks/</feedburner:origLink></item>
		<item>
		<title>Slides for decorator talk</title>
		<link>http://feeds.feedburner.com/~r/tplus1/wtPt/~3/451841794/</link>
		<comments>http://blog.tplus1.com/index.php/2008/11/13/slides-for-decorator-talk/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 14:32:22 +0000</pubDate>
		<dc:creator>matt</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.tplus1.com/?p=252</guid>
		<description><![CDATA[SLIDES RIGHT HERE
ZIP FILE RIGHT HERE


<script type="text/javascript">
SHARETHIS.addEntry({
	title: "Slides for decorator talk",
	url: "http://blog.tplus1.com/index.php/2008/11/13/slides-for-decorator-talk/"
});
</script>
	]]></description>
			<content:encoded><![CDATA[<p><a href="http://scratch.tplus1.com/decoratortalk/">SLIDES RIGHT HERE</a></p>
<p><a href="http://scratch.tplus1.com/decoratortalk.zip">ZIP FILE RIGHT HERE</a></p>
<p><a href="http://sharethis.com/item?publisher=4bc7005e-aa8c-421e-a726-24badd341a96&title=Slides+for+decorator+talk&url=http%3A%2F%2Fblog.tplus1.com%2Findex.php%2F2008%2F11%2F13%2Fslides-for-decorator-talk%2F">ShareThis</a></p>
<p><a href="http://feeds.feedburner.com/~a/tplus1/wtPt?a=k3ozLT"><img src="http://feeds.feedburner.com/~a/tplus1/wtPt?i=k3ozLT" border="0"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.tplus1.com/index.php/2008/11/13/slides-for-decorator-talk/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.tplus1.com/index.php/2008/11/13/slides-for-decorator-talk/</feedburner:origLink></item>
		<item>
		<title>I have worse taste in movies than you.</title>
		<link>http://feeds.feedburner.com/~r/tplus1/wtPt/~3/450076777/</link>
		<comments>http://blog.tplus1.com/index.php/2008/11/11/i-have-worse-taste-in-movies-than-you/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 23:24:11 +0000</pubDate>
		<dc:creator>matt</dc:creator>
		
		<category><![CDATA[self-aggrandizement]]></category>

		<guid isPermaLink="false">http://blog.tplus1.com/?p=251</guid>
		<description><![CDATA[By worse, I mean any of:

better
more obscure
crasser
worse

You can see my netflix queue and become my Netflix Friend when you click on this link.


<script type="text/javascript">
SHARETHIS.addEntry({
	title: "I have worse taste in movies than you.",
	url: "http://blog.tplus1.com/index.php/2008/11/11/i-have-worse-taste-in-movies-than-you/"
});
</script>
	]]></description>
			<content:encoded><![CDATA[<p>By worse, I mean any of:</p>
<ul>
<li>better</li>
<li>more obscure</li>
<li>crasser</li>
<li>worse</li>
</ul>
<p><a href="http://www.netflix.com/BeMyFriend/P8p4IkH4mzDmtY8EL0SO">You can see my netflix queue and become my Netflix Friend when you click on this link</a>.</p>
<p><a href="http://sharethis.com/item?publisher=4bc7005e-aa8c-421e-a726-24badd341a96&title=I+have+worse+taste+in+movies+than+you.&url=http%3A%2F%2Fblog.tplus1.com%2Findex.php%2F2008%2F11%2F11%2Fi-have-worse-taste-in-movies-than-you%2F">ShareThis</a></p>
<p><a href="http://feeds.feedburner.com/~a/tplus1/wtPt?a=1Zgkud"><img src="http://feeds.feedburner.com/~a/tplus1/wtPt?i=1Zgkud" border="0"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.tplus1.com/index.php/2008/11/11/i-have-worse-taste-in-movies-than-you/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.tplus1.com/index.php/2008/11/11/i-have-worse-taste-in-movies-than-you/</feedburner:origLink></item>
		<item>
		<title>Which one of you did this?</title>
		<link>http://feeds.feedburner.com/~r/tplus1/wtPt/~3/448946543/</link>
		<comments>http://blog.tplus1.com/index.php/2008/11/10/which-one-of-you-did-this/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 00:01:17 +0000</pubDate>
		<dc:creator>matt</dc:creator>
		
		<category><![CDATA[mlp]]></category>

		<guid isPermaLink="false">http://blog.tplus1.com/?p=250</guid>
		<description><![CDATA[A two-year old elephant in the Houston Zoo died of the herpes virus.
We&#8217;ll all know who you are soon &#8212; you can&#8217;t hide your cold sores forever.


<script type="text/javascript">
SHARETHIS.addEntry({
	title: "Which one of you did this?",
	url: "http://blog.tplus1.com/index.php/2008/11/10/which-one-of-you-did-this/"
});
</script>
	]]></description>
			<content:encoded><![CDATA[<p><a href="http://link.brightcove.com/services/link/bcpid823425601/bclid958498245/bctid1896800113">A two-year old elephant in the Houston Zoo died of the herpes virus</a>.</p>
<p>We&#8217;ll all know who you are soon &#8212; you can&#8217;t hide your cold sores forever.</p>
<p><a href="http://sharethis.com/item?publisher=4bc7005e-aa8c-421e-a726-24badd341a96&title=Which+one+of+you+did+this%3F&url=http%3A%2F%2Fblog.tplus1.com%2Findex.php%2F2008%2F11%2F10%2Fwhich-one-of-you-did-this%2F">ShareThis</a></p>
<p><a href="http://feeds.feedburner.com/~a/tplus1/wtPt?a=4p0jr6"><img src="http://feeds.feedburner.com/~a/tplus1/wtPt?i=4p0jr6" border="0"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.tplus1.com/index.php/2008/11/10/which-one-of-you-did-this/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.tplus1.com/index.php/2008/11/10/which-one-of-you-did-this/</feedburner:origLink></item>
		<item>
		<title>Maybe the Browns should stop hiring the undead</title>
		<link>http://feeds.feedburner.com/~r/tplus1/wtPt/~3/447866597/</link>
		<comments>http://blog.tplus1.com/index.php/2008/11/09/maybe-the-browns-should-stop-hiring-the-undead/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 00:27:59 +0000</pubDate>
		<dc:creator>matt</dc:creator>
		
		<category><![CDATA[Cleveland Life]]></category>

		<guid isPermaLink="false">http://blog.tplus1.com/?p=249</guid>
		<description><![CDATA[Seriously &#8212; what is wrong with this guy?  He looks like a vampire that isn&#8217;t getting enough blood.  Maybe Bilbo stole his precious.



<script type="text/javascript">
SHARETHIS.addEntry({
	title: "Maybe the Browns should stop hiring the undead",
	url: "http://blog.tplus1.com/index.php/2008/11/09/maybe-the-browns-should-stop-hiring-the-undead/"
});
</script>
	]]></description>
			<content:encoded><![CDATA[<p>Seriously &#8212; what is wrong with this guy?  He looks like a vampire that isn&#8217;t getting enough blood.  Maybe Bilbo stole his precious.</p>
<p><a href="http://www.cleveland.com/browns/index.ssf/2008/11/analysis_much_work_awaits_to_r.html"><img src="http://blog.cleveland.com/browns_impact/2008/11/medium_savagetd.jpg" alt="undead vampire coach" /></a></p>
<p><a href="http://sharethis.com/item?publisher=4bc7005e-aa8c-421e-a726-24badd341a96&title=Maybe+the+Browns+should+stop+hiring+the+undead&url=http%3A%2F%2Fblog.tplus1.com%2Findex.php%2F2008%2F11%2F09%2Fmaybe-the-browns-should-stop-hiring-the-undead%2F">ShareThis</a></p>
<p><a href="http://feeds.feedburner.com/~a/tplus1/wtPt?a=dGUlG7"><img src="http://feeds.feedburner.com/~a/tplus1/wtPt?i=dGUlG7" border="0"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.tplus1.com/index.php/2008/11/09/maybe-the-browns-should-stop-hiring-the-undead/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.tplus1.com/index.php/2008/11/09/maybe-the-browns-should-stop-hiring-the-undead/</feedburner:origLink></item>
		<item>
		<title>I wrote some ruby code today</title>
		<link>http://feeds.feedburner.com/~r/tplus1/wtPt/~3/447638211/</link>
		<comments>http://blog.tplus1.com/index.php/2008/11/09/i-wrote-some-ruby-code-today/#comments</comments>
		<pubDate>Sun, 09 Nov 2008 19:00:14 +0000</pubDate>
		<dc:creator>matt</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.tplus1.com/?p=248</guid>
		<description><![CDATA[I&#8217;ve been using ditz for a few months now.  It&#8217;s a bugtracking system like trac or bugzilla except that it doesn&#8217;t run in a centralized server.  Instead, it lives as a bunch of text files inside your SCM.
Ditz is written in ruby, and it uses yaml files to store all the issues (tickets) [...]

<script type="text/javascript">
SHARETHIS.addEntry({
	title: "I wrote some ruby code today",
	url: "http://blog.tplus1.com/index.php/2008/11/09/i-wrote-some-ruby-code-today/"
});
</script>
	]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using <a href="http://ditz.rubyforge.org">ditz</a> for a few months now.  It&#8217;s a bugtracking system like trac or bugzilla except that it doesn&#8217;t run in a centralized server.  Instead, it lives as a bunch of text files inside your SCM.</p>
<p>Ditz is written in ruby, and it uses yaml files to store all the issues (tickets) and groupings of issues.  Ditz allows issues to be grouped into releases.<br />
<code><br />
$ ditz releases<br />
0.6 (unreleased)<br />
0.4 (released 2008-07-27)<br />
0.5 (released 2008-08-20)<br />
</code><br />
I wrote an extension that would show all the issues attached to a particular release, like this:<br />
<code><br />
$ ditz help ri<br />
Show issues for a particular release.<br />
Usage: ditz ri &lt;release&gt;<br />
&nbsp;<br />
$ ditz ri<br />
Error: command &#039;ri&#039; requires a release<br />
&nbsp;<br />
$ ditz ri bogus<br />
Error: no release with name bogus<br />
&nbsp;<br />
$ ditz ri 0.6<br />
x&nbsp;&nbsp;ditz-61: Use text editor for multiline input where possible.<br />
x&nbsp;&nbsp;ditz-72: add model object post-creation validation<br />
x&nbsp;&nbsp;ditz-71: &#039;ditz add&#039; shouldn&#039;t ask for comments<br />
x&nbsp;&nbsp;ditz-76: allow configuration of whether the editor is used or not<br />
x&nbsp;&nbsp;ditz-69: Store issues in .ditz directory by default<br />
_&nbsp;&nbsp;ditz-42: support tiny issue identifiers (like #34) in the single-component case<br />
x sheila-1: check for a &quot;git push&quot; having updated the issue db, and reload if so<br />
&#46;&#8230; lots more issues snipped for brevity.<br />
</code></p>
<p>Thanks to all the really neat plumbing already built into ditz, my patch was trivial to write:<br />
<code><br />
operation :ri, &quot;Show issues for a particular release&quot;, :release do<br />
end <br />
def ri project, config, opts, release<br />
&nbsp;&nbsp;puts todo_list_for(release.issues_from(project))<br />
end<br />
</code></p>
<p>Ruby is a pretty neat language and people do neat stuff with symbols.  In that code above, the operation method takes the symbol :ri and effectively decorates my ri method with the help text.  I&#8217;m really impressed by how ditz took the fact that my ri method takes a :release symbol as a parameter, and because of that, it knew how to search in the list of releases and then give me the relevant release.</p>
<p><a href="http://sharethis.com/item?publisher=4bc7005e-aa8c-421e-a726-24badd341a96&title=I+wrote+some+ruby+code+today&url=http%3A%2F%2Fblog.tplus1.com%2Findex.php%2F2008%2F11%2F09%2Fi-wrote-some-ruby-code-today%2F">ShareThis</a></p>
<p><a href="http://feeds.feedburner.com/~a/tplus1/wtPt?a=MBI4Vz"><img src="http://feeds.feedburner.com/~a/tplus1/wtPt?i=MBI4Vz" border="0"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.tplus1.com/index.php/2008/11/09/i-wrote-some-ruby-code-today/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.tplus1.com/index.php/2008/11/09/i-wrote-some-ruby-code-today/</feedburner:origLink></item>
		<item>
		<title>I learned some neat stuff at clepy last night</title>
		<link>http://feeds.feedburner.com/~r/tplus1/wtPt/~3/442487177/</link>
		<comments>http://blog.tplus1.com/index.php/2008/11/04/i-learned-some-neat-stuff-at-clepy-last-night/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 20:37:40 +0000</pubDate>
		<dc:creator>matt</dc:creator>
		
		<category><![CDATA[Cleveland Life]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Python]]></category>

		<category><![CDATA[clepy]]></category>

		<guid isPermaLink="false">http://blog.tplus1.com/?p=245</guid>
		<description><![CDATA[Brian Beck showed how to use metaclasses and descriptors to make DSLs with python.
I do this kind of this kind of thing every so often in my code:

def f(x):
&#160;&#160;&#160;&#160;class C(object):
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;y = x
&#160;&#160;&#160;&#160;return C

That function takes a parameter and makes and returns a class based on that parameter.  Whoop-di-do.  I was surprised to learn [...]

<script type="text/javascript">
SHARETHIS.addEntry({
	title: "I learned some neat stuff at clepy last night",
	url: "http://blog.tplus1.com/index.php/2008/11/04/i-learned-some-neat-stuff-at-clepy-last-night/"
});
</script>
	]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.brianbeck.com">Brian Beck</a> showed how to use metaclasses and descriptors to make DSLs with python.</p>
<p>I do this kind of this kind of thing every so often in my code:<br />
<code><br />
def f(x):<br />
&nbsp;&nbsp;&nbsp;&nbsp;class C(object):<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y = x<br />
&nbsp;&nbsp;&nbsp;&nbsp;return C<br />
</code></p>
<p>That function takes a parameter and makes and returns a class based on that parameter.  Whoop-di-do.  I was surprised to learn that you can&#8217;t do this:<br />
<code><br />
class C(object):<br />
&nbsp;&nbsp;&nbsp;&nbsp;x = 99<br />
&nbsp;&nbsp;&nbsp;&nbsp;class D(object):<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y = x + 1<br />
</code></p>
<p>I gotta explore this some more until it makes sense.</p>
<p>Here&#8217;s another neat trick:  It isn&#8217;t possible to add two classes together:<br />
<code><br />
&gt;&gt;&gt; class C(object):<br />
&#46;..&nbsp;&nbsp;&nbsp;&nbsp; pass<br />
&#46;..<br />
&gt;&gt;&gt; C + C<br />
&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-&#45;&#45;-<br />
Traceback (most recent call last):<br />
&nbsp;&nbsp;File &quot;&lt;ipython console&gt;&quot;, line 1, in &lt;module&gt;<br />
TypeError: unsupported operand type(s) for +: &#039;type&#039; and &#039;type&#039;<br />
</code></p>
<p>But if you want to support this, the solution would be to define an __add__ method on the metaclass:<br />
<code><br />
&gt;&gt;&gt; type(C)<br />
&lt;type &#039;type&#039;&gt;<br />
&gt;&gt;&gt; class MC(type):<br />
&#46;..&nbsp;&nbsp;&nbsp;&nbsp; def __add__(self, other):<br />
&#46;..&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print &#039;Adding!&#039;<br />
&#46;..&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 99<br />
&#46;.. <br />
&gt;&gt;&gt; class C(object):<br />
&#46;..&nbsp;&nbsp;&nbsp;&nbsp; __metaclass__ = MC<br />
&#46;.. <br />
&gt;&gt;&gt; C + C<br />
Adding!<br />
99<br />
</code></p>
<p>Wacky, right?  More realistically, I could build a new class by taking attributes of both classes together.  In other words, if class C has a class attribute x, and class D has a class attribute y, then we can use a metaclass to add C and D together to get a new class E, that has both x and y as class attributes.</p>
<p>In this example, C has a class attribute x and D has a class attribute y.  When I add the two classes, I get a new class with both of those class attributes.<br />
<code><br />
&gt;&gt;&gt; C.x, D.y<br />
(99, 98)<br />
&gt;&gt;&gt; E = C + D<br />
&gt;&gt;&gt; E.x, E.y<br />
(99, 98)<br />
</code></p>
<p>Here&#8217;s the metaclass that allows this sort of nonsense:<br />
<code><br />
class MC(type):<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;def __add__(self, other):<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;class E(self):<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pass<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for k,v in other.__dict__.items():<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if k not in (&#039;__dict__&#039;, ):<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;setattr(E, k, v)<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return E<br />
</code></p>
<p><a href="http://sharethis.com/item?publisher=4bc7005e-aa8c-421e-a726-24badd341a96&title=I+learned+some+neat+stuff+at+clepy+last+night&url=http%3A%2F%2Fblog.tplus1.com%2Findex.php%2F2008%2F11%2F04%2Fi-learned-some-neat-stuff-at-clepy-last-night%2F">ShareThis</a></p>
<p><a href="http://feeds.feedburner.com/~a/tplus1/wtPt?a=To8qZr"><img src="http://feeds.feedburner.com/~a/tplus1/wtPt?i=To8qZr" border="0"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.tplus1.com/index.php/2008/11/04/i-learned-some-neat-stuff-at-clepy-last-night/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.tplus1.com/index.php/2008/11/04/i-learned-some-neat-stuff-at-clepy-last-night/</feedburner:origLink></item>
		<item>
		<title>Anybody want to meet up on Wednesday night before PyWorks?</title>
		<link>http://feeds.feedburner.com/~r/tplus1/wtPt/~3/440227716/</link>
		<comments>http://blog.tplus1.com/index.php/2008/11/02/anybody-want-to-meet-up-on-wednesday-night-before-pyworks/#comments</comments>
		<pubDate>Sun, 02 Nov 2008 19:42:18 +0000</pubDate>
		<dc:creator>matt</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://blog.tplus1.com/?p=243</guid>
		<description><![CDATA[ I&#8217;m doing a talk at PyWorks, and I&#8217;m getting into town Wednesday afternoon.
Anybody want to get dinner or meet up that evening?  We can talk about Python or theorize about these things.
Anyhow, the slides for my talk are here.  I&#8217;m going to update them before the talk with more detail on class [...]

<script type="text/javascript">
SHARETHIS.addEntry({
	title: "Anybody want to meet up on Wednesday night before PyWorks?",
	url: "http://blog.tplus1.com/index.php/2008/11/02/anybody-want-to-meet-up-on-wednesday-night-before-pyworks/"
});
</script>
	]]></description>
			<content:encoded><![CDATA[<p><a href='http://blog.tplus1.com/wp-content/uploads/2008/11/pyworks_08_speaker_button.jpg'><img src="http://blog.tplus1.com/wp-content/uploads/2008/11/pyworks_08_speaker_button.jpg" alt="speaker button" title="pyworks_08_speaker_button" width="150" height="106" class="alignleft size-full wp-image-242" /></a> I&#8217;m doing a talk at PyWorks, and I&#8217;m getting into town Wednesday afternoon.</p>
<p>Anybody want to get dinner or meet up that evening?  We can talk about Python or theorize about <a href="http://en.wikipedia.org/wiki/Georgia_Guidestones">these things</a>.</p>
<p>Anyhow, the slides for my talk are <a href="http://scratch.tplus1.com/decoratortalk/">here</a>.  I&#8217;m going to update them before the talk with more detail on class decorators vs metaclasses.  I welcome feedback.</p>
<p><a href="http://sharethis.com/item?publisher=4bc7005e-aa8c-421e-a726-24badd341a96&title=Anybody+want+to+meet+up+on+Wednesday+night+before+PyWorks%3F&url=http%3A%2F%2Fblog.tplus1.com%2Findex.php%2F2008%2F11%2F02%2Fanybody-want-to-meet-up-on-wednesday-night-before-pyworks%2F">ShareThis</a></p>
<p><a href="http://feeds.feedburner.com/~a/tplus1/wtPt?a=ruPINo"><img src="http://feeds.feedburner.com/~a/tplus1/wtPt?i=ruPINo" border="0"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.tplus1.com/index.php/2008/11/02/anybody-want-to-meet-up-on-wednesday-night-before-pyworks/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.tplus1.com/index.php/2008/11/02/anybody-want-to-meet-up-on-wednesday-night-before-pyworks/</feedburner:origLink></item>
		<item>
		<title>Funny blog</title>
		<link>http://feeds.feedburner.com/~r/tplus1/wtPt/~3/439181968/</link>
		<comments>http://blog.tplus1.com/index.php/2008/11/01/funny-blog/#comments</comments>
		<pubDate>Sat, 01 Nov 2008 16:46:50 +0000</pubDate>
		<dc:creator>matt</dc:creator>
		
		<category><![CDATA[mlp]]></category>

		<guid isPermaLink="false">http://blog.tplus1.com/?p=241</guid>
		<description><![CDATA[The Houston Chronicle is doing something that I haven&#8217;t seen any other paper do &#8212; it hosts blogs and photos for its readers, and it draws links to those blogs from the front page.
Anyhow, I like this post a lot.


<script type="text/javascript">
SHARETHIS.addEntry({
	title: "Funny blog",
	url: "http://blog.tplus1.com/index.php/2008/11/01/funny-blog/"
});
</script>
	]]></description>
			<content:encoded><![CDATA[<p>The Houston Chronicle is doing something that I haven&#8217;t seen any other paper do &#8212; it hosts blogs and photos for its readers, and it draws links to those blogs from the front page.</p>
<p>Anyhow, I like <a href="http://www.chron.com/commons/persona.html?newspaperUserId=texasliberal&#038;plckController=PersonaBlog&#038;plckScript=personaScript&#038;plckElementId=personaDest&#038;plckPersonaPage=BlogViewPost&#038;plckPostId=Blog%3atexasliberalPost%3a94bcba0e-0e67-4d20-8613-97c7ee79843d&#038;plckCommentSortOrder=TimeStampAscending">this post</a> a lot.</p>
<p><a href="http://sharethis.com/item?publisher=4bc7005e-aa8c-421e-a726-24badd341a96&title=Funny+blog&url=http%3A%2F%2Fblog.tplus1.com%2Findex.php%2F2008%2F11%2F01%2Ffunny-blog%2F">ShareThis</a></p>
<p><a href="http://feeds.feedburner.com/~a/tplus1/wtPt?a=n8xLcc"><img src="http://feeds.feedburner.com/~a/tplus1/wtPt?i=n8xLcc" border="0"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.tplus1.com/index.php/2008/11/01/funny-blog/feed/</wfw:commentRss>
		<feedburner:origLink>http://blog.tplus1.com/index.php/2008/11/01/funny-blog/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic Page Served (once) in 0.319 seconds --><!-- Cached page served by WP-Cache -->
