<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>t+1 &#187; self-aggrandizement</title>
	<atom:link href="http://blog.tplus1.com/index.php/category/self-aggrandizement/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tplus1.com</link>
	<description>Programming, gardening, economics, life in Cleveland Heights</description>
	<lastBuildDate>Sat, 07 Jan 2012 21:12:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>I just submitted my talk for PyOhio 2010</title>
		<link>http://blog.tplus1.com/index.php/2010/05/09/i-just-submitted-my-talk-for-pyohio-2010/</link>
		<comments>http://blog.tplus1.com/index.php/2010/05/09/i-just-submitted-my-talk-for-pyohio-2010/#comments</comments>
		<pubDate>Sun, 09 May 2010 17:01:44 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[self-aggrandizement]]></category>

		<guid isPermaLink="false">http://blog.tplus1.com/?p=595</guid>
		<description><![CDATA[I&#8217;d be happy to get any crititicism ahead of the presentation.  I&#8217;m hosting the code examples and the talk material here.
Building your own kind of dictionary
Python level: novice
Description
My talk is based on a project that seemed very simple at first.  I wanted an object like the regular python dictionary, but with a few [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;d be happy to get any crititicism ahead of the presentation.  I&#8217;m hosting the code examples and the talk material <a href="http://github.com/mw44118/your-own-kind-of-dictionary">here</a>.</p>
<h2>Building your own kind of dictionary</h2>
<p><em>Python level: novice</em></p>
<h3>Description</h3>
<p>My talk is based on a project that seemed very simple at first.  I wanted an object like the regular python dictionary, but with a few small tweaks:</p>
<ul>
<li>values for some keys should be restricted to elements of a set</li>
<li>values for some keys should be restricted to instances of a type</li>
</ul>
<p>For example, pretend I want a dictionary called favorites, and I want the value for the &#8220;color&#8221; key to be any instance of my Color class.  Meanwhile, for the &#8220;movie&#8221; key, I want to make sure that the value belongs to my set of movies.</p>
<p>In the talk, I&#8217;ll walk through how I used tests to validate my different implementations until I came up with a winner.</p>
<p>Unlike my talk last year on metaclass tomfoolery, and the year before that on fun with decorators (and decorator factories) I&#8217;m hoping to make this talk straightforward and friendly to beginning programmers.</p>
<p>You&#8217;ll see:</p>
<ul>
<li>how I use tests to solve a real-world problem</li>
<li>gotchas with the super keyword</li>
<li>a little about how python works under the hood.</li>
</ul>
<h3>Extended description</h3>
<p>I&#8217;m not done with the slides, but all my code examples are finished.  You can read it all online at my github repository <a href="http://github.com/mw44118/your-own-kind-of-dictionary">here</a>.</p>
<h3>Outline</h3>
<ol>
<li>What kind of object I want
<ol>
<li>Tests define the expected behavior</li>
<li>How to run those tests</li>
</ol>
</li>
<li>First implementation (subclass dict)
<ol>
<li>How the implementation is defined</li>
<li>Examine test results</li>
<li>Examine the C code behind the dict class to see why my subclassed __setitem__ method won&#8217;t get called from the parent class</li>
</ol>
</li>
<li>Composition-based implementation
<ol>
<li>Explain composition vs inheritance</li>
<li>Examine test results</li>
<li>Point out irritating need to manually redefine every related dictionary method on the container class</li>
<li>Show how to use __getattr__ to avoid all that boring wrapper code</li>
<li>Show how __getattr__ doesn&#8217;t play nice with inspection tools</li>
</ol>
</li>
<li>UserDict.UserDict
<ol>
<li>Explain implementation</li>
<li>Examine test results</li>
<li>Add a new test that uses this class as a parent for a subclass</li>
<li>Explain how UserDict.UserDict is not a new-style class, so the super keyword behaves differently</li>
</ol>
</li>
<li>UserDict.DictMixin
<ol>
<li>Explain implementation</li>
<li>Examine test results</li>
</ol>
</li>
<li>PEP 3119 and why it is nice
<ol>
<li>duck-typing, why it is awesome, why it isn&#8217;t perfect</li>
<li>abstract base classes</li>
<li>As of python 2.6, don&#8217;t use UserDict.DictMixin; use collections.MutableMapping</li>
</ol>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.tplus1.com/index.php/2010/05/09/i-just-submitted-my-talk-for-pyohio-2010/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Two @#$@#ING commas</title>
		<link>http://blog.tplus1.com/index.php/2009/10/16/two-ing-commas/</link>
		<comments>http://blog.tplus1.com/index.php/2009/10/16/two-ing-commas/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 18:10:01 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[self-aggrandizement]]></category>
		<category><![CDATA[startup life]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://blog.tplus1.com/?p=472</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.tplus1.com/wp-content/uploads/2009/10/available_balance1.jpg"><img src="http://blog.tplus1.com/wp-content/uploads/2009/10/available_balance1.jpg" alt="available_balance" title="available_balance" width="449" height="96" class="alignleft size-full wp-image-478" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tplus1.com/index.php/2009/10/16/two-ing-commas/feed/</wfw:commentRss>
		<slash:comments>-1</slash:comments>
		</item>
		<item>
		<title>Video from my metaclass talk</title>
		<link>http://blog.tplus1.com/index.php/2009/07/27/video-from-my-metaclass-talk/</link>
		<comments>http://blog.tplus1.com/index.php/2009/07/27/video-from-my-metaclass-talk/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 16:47:18 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[self-aggrandizement]]></category>

		<guid isPermaLink="false">http://blog.tplus1.com/index.php/2009/07/27/video-from-my-metaclass-talk/</guid>
		<description><![CDATA[The video doesn&#8217;t capture my BO, but otherwise, it&#8217;s pretty accurate.
 
]]></description>
			<content:encoded><![CDATA[<p>The video doesn&#8217;t capture my BO, but otherwise, it&#8217;s pretty accurate.</p>
<p><embed src="http://blip.tv/play/AYGcvWoC" type="application/x-shockwave-flash" width="480" height="350" allowscriptaccess="always" allowfullscreen="true"></embed> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tplus1.com/index.php/2009/07/27/video-from-my-metaclass-talk/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Clever uses for metaclasses talk now at git hub</title>
		<link>http://blog.tplus1.com/index.php/2009/07/27/clever-uses-for-metaclasses-talk-now-at-git-hub/</link>
		<comments>http://blog.tplus1.com/index.php/2009/07/27/clever-uses-for-metaclasses-talk-now-at-git-hub/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 11:57:16 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[self-aggrandizement]]></category>

		<guid isPermaLink="false">http://blog.tplus1.com/index.php/2009/07/27/clever-uses-for-metaclasses-talk-now-at-git-hub/</guid>
		<description><![CDATA[I uploaded the code and my notes for my metaclasses talk to github here.
I&#8217;ll probably carve it up into a series of blog posts soon.
]]></description>
			<content:encoded><![CDATA[<p>I uploaded the code and my notes for my metaclasses talk to github <a href="http://github.com/mw44118/pyohio-metaclasses-talk/tree/master">here</a>.</p>
<p>I&#8217;ll probably carve it up into a series of blog posts soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tplus1.com/index.php/2009/07/27/clever-uses-for-metaclasses-talk-now-at-git-hub/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>My decorators article is in top ten articles for the year on Linux Magazine</title>
		<link>http://blog.tplus1.com/index.php/2008/12/01/my-decorators-article-is-in-top-ten-articles-for-the-year-on-linux-magazine/</link>
		<comments>http://blog.tplus1.com/index.php/2008/12/01/my-decorators-article-is-in-top-ten-articles-for-the-year-on-linux-magazine/#comments</comments>
		<pubDate>Mon, 01 Dec 2008 15:30:56 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[self-aggrandizement]]></category>

		<guid isPermaLink="false">http://blog.tplus1.com/?p=260</guid>
		<description><![CDATA[woo hoo!
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.linux-mag.com/id/7190">woo hoo!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tplus1.com/index.php/2008/12/01/my-decorators-article-is-in-top-ten-articles-for-the-year-on-linux-magazine/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>My metaclass article published</title>
		<link>http://blog.tplus1.com/index.php/2008/11/24/my-metaclass-article-published/</link>
		<comments>http://blog.tplus1.com/index.php/2008/11/24/my-metaclass-article-published/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 16:08:59 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[self-aggrandizement]]></category>

		<guid isPermaLink="false">http://blog.tplus1.com/?p=257</guid>
		<description><![CDATA[The November issue of Python Magazine has my article on metaclasses.  I regain the rights to my text after 3 months, so I&#8217;ll be posting sections of that article here as blog posts over the next year.
In the meantime, I&#8217;d love to hear critical feedback so that I can improve the material.
Or if you [...]]]></description>
			<content:encoded><![CDATA[<p>The November issue of <a href="http://pymag.phparch.com/">Python Magazine</a> has my article on metaclasses.  I regain the rights to my text after 3 months, so I&#8217;ll be posting sections of that article here as blog posts over the next year.</p>
<p>In the meantime, I&#8217;d love to hear critical feedback so that I can improve the material.</p>
<p>Or if you want to write a message telling me how awesome I am, that&#8217;s cool too, but I would prefer you give me money.  In fact, that applies to people that want to call me an idiot.  You also should just give me money.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tplus1.com/index.php/2008/11/24/my-metaclass-article-published/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>I have worse taste in movies than you.</title>
		<link>http://blog.tplus1.com/index.php/2008/11/11/i-have-worse-taste-in-movies-than-you/</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.
]]></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>
]]></content:encoded>
			<wfw:commentRss>http://blog.tplus1.com/index.php/2008/11/11/i-have-worse-taste-in-movies-than-you/feed/</wfw:commentRss>
		<slash:comments>-1</slash:comments>
		</item>
		<item>
		<title>My proposed talk for PyOhio</title>
		<link>http://blog.tplus1.com/index.php/2008/05/19/my-proposed-talk-for-pyohio/</link>
		<comments>http://blog.tplus1.com/index.php/2008/05/19/my-proposed-talk-for-pyohio/#comments</comments>
		<pubDate>Mon, 19 May 2008 15:32:48 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[self-aggrandizement]]></category>

		<guid isPermaLink="false">http://blog.tplus1.com/index.php/2008/05/19/my-proposed-talk-for-pyohio/</guid>
		<description><![CDATA[Here&#8217;s what I submitted for a presentation topic for PyOhio:
TITLE: Decorators are fun
EXPERTISE LEVEL: Hopefully, there will be something for everyone.  Novices might enjoy the material at the beginning mostly, while experts would likely be more interested in the ruledispatch discussion.
SUMMARY: This talk will start with a friendly walkthrough of decorators for people that [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s what I submitted for a presentation topic for <a href="http://pyohio.org">PyOhio</a>:</p>
<p>TITLE: Decorators are fun</p>
<p>EXPERTISE LEVEL: Hopefully, there will be something for everyone.  Novices might enjoy the material at the beginning mostly, while experts would likely be more interested in the ruledispatch discussion.</p>
<p>SUMMARY: This talk will start with a friendly walkthrough of decorators for people that have never seen them, then go into some straightforward examples, then finish with a review of how decorators are used in Philip Eby&#8217;s ruledispatch package.  </p>
<p>OUTLINE:</p>
<ul>
<li>The simplest possible decorator.</li>
<li>Pass arguments to a decorator.</li>
<li>Write a decorator and still preserve the function signature of the decorated function.</li>
<li> Coerce values into a function into types using decorators.</li>
<li>Log values coming out of a function.</li>
<li>Phillip Eby&#8217;s ruledispatch package implements generic functions, aka <a href="http://en.wikipedia.org/wiki/Multimethod">multimethods</a>, for python.  I&#8217;ll walk through how he uses decorators, and why they&#8217;re such a good idea for this.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.tplus1.com/index.php/2008/05/19/my-proposed-talk-for-pyohio/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>My article is finally online</title>
		<link>http://blog.tplus1.com/index.php/2008/04/09/my-article-is-finally-online/</link>
		<comments>http://blog.tplus1.com/index.php/2008/04/09/my-article-is-finally-online/#comments</comments>
		<pubDate>Thu, 10 Apr 2008 01:58:22 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[self-aggrandizement]]></category>

		<guid isPermaLink="false">http://blog.tplus1.com/index.php/2008/04/09/my-article-is-finally-online/</guid>
		<description><![CDATA[Introduction to Python Decorators is available for you to read after you fill out the annoying registration form.
I have a few ideas for the next article.  Do any of these seem interesting?

Demystify metaclasses: use metaclasses to add camel-cased aliases for underscored method names, show how to automatically make methods into properties, and build a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.linux-mag.com/id/5377">Introduction to Python Decorators</a> is available for you to read after you fill out the annoying registration form.</p>
<p>I have a few ideas for the next article.  Do any of these seem interesting?</p>
<ol>
<li style="list-style:lower-greek">Demystify metaclasses: use metaclasses to add camel-cased aliases for underscored method names, show how to automatically make methods into properties, and build a crude ORM.</li>
<li style="list-style:lower-greek">Explore logging with python, ranging from writing out to local files to setting up a syslog-ng server.  Show how to use logging config files and filters.</li>
<li style="list-style:lower-greek">Build a <a href="http://en.wikipedia.org/wiki/Prototype-based_programming">prototype inheritance system</a> into python.  I got really interested in prototype inheritance when I studied lua.  Prototypes make it really easy to change class-based behaviors at run time.</li>
</ol>
<p>Finally, the meaning behind the pirates-vs-ninjas debate became clear to me during a recent nitrous-oxide haze (no, not how you think; I was getting my teeth cleaned at the dentist).  Anyhow, pirates and ninjas are symbols.</p>
<p>The ninja is a metaphor for the corporate employee.  A ninja will get the job done or die trying.  A ninja will kill everyone in his own family if he&#8217;s ordered to.  A ninja has no sense of entitlement or dignity or flex time.</p>
<p>Meanwhile, the pirate is the entrepeneur, or maybe the upper-level executive.  He has no sense of duty or honor.  He seeks adventure and glory only.  He&#8217;ll jump ship as soon as possible.  He might even maroon his crew-mates on a desert island if it means he gets the treasure to himself.</p>
<p>Pirates love to hire ninjas because a ninja never disobeys.  Ninjas love to kill pirates because they can pretend they&#8217;re killing their own pirate boss.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tplus1.com/index.php/2008/04/09/my-article-is-finally-online/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>I am a professional writer!</title>
		<link>http://blog.tplus1.com/index.php/2008/02/19/i-am-a-professional-writer/</link>
		<comments>http://blog.tplus1.com/index.php/2008/02/19/i-am-a-professional-writer/#comments</comments>
		<pubDate>Tue, 19 Feb 2008 17:21:29 +0000</pubDate>
		<dc:creator>matt</dc:creator>
				<category><![CDATA[self-aggrandizement]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://blog.tplus1.com/index.php/2008/02/19/i-am-a-professional-writer/</guid>
		<description><![CDATA[
Even though this check is not an advance on my awesome unfinished sci-fi novel*, it still feels really good to get a check and the liquor store clerk will cash it just the same.
[*] It&#8217;s like Star Trek meets the Breakfast Club.
]]></description>
			<content:encoded><![CDATA[<p><a href='http://blog.tplus1.com/wp-content/uploads/2008/02/photo0307.jpg' title='paycheck'><img src='http://blog.tplus1.com/wp-content/uploads/2008/02/photo0307.jpg' alt='paycheck' /></a></p>
<p>Even though this check is not an advance on my awesome unfinished sci-fi novel*, it still feels really good to get a check and the liquor store clerk will cash it just the same.</p>
<p>[*] It&#8217;s like Star Trek meets the Breakfast Club.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tplus1.com/index.php/2008/02/19/i-am-a-professional-writer/feed/</wfw:commentRss>
		<slash:comments>-1</slash:comments>
		</item>
	</channel>
</rss>

