<?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>Reliably Broken &#187; gotchas</title>
	<atom:link href="http://reliablybroken.com/b/tag/gotchas/feed/" rel="self" type="application/rss+xml" />
	<link>http://reliablybroken.com/b</link>
	<description>It&#039;s a blog: let&#039;s do funch!</description>
	<lastBuildDate>Sat, 04 Sep 2010 21:22:45 +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>Network users and Mac 10.5 archive and install</title>
		<link>http://reliablybroken.com/b/2009/11/network-users-and-mac-10-5-archive-and-install/</link>
		<comments>http://reliablybroken.com/b/2009/11/network-users-and-mac-10-5-archive-and-install/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 18:25:07 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[active directory]]></category>
		<category><![CDATA[gotchas]]></category>
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://reliablybroken.com/b/?p=313</guid>
		<description><![CDATA[When upgrading a Mac from Mac OS X 10.4 (Tiger) to 10.5 (Leopard), remember that network accounts are not included if you do an archive and install and choose to migrate existing users. If a network account had its home folder at /Users/jbloggs then it will have been moved to /Previous Systems.localized/2009-11-06_0346/Users/jbloggs (although the date [...]]]></description>
			<content:encoded><![CDATA[<p>When upgrading a Mac from Mac OS X 10.4 (Tiger) to 10.5 (Leopard), remember that network accounts are <em>not</em> included if you do an archive and install and choose to migrate existing users. If a network account had its home folder at <code>/Users/jbloggs</code> then it will have been moved to <code>/Previous Systems.localized/2009-11-06_0346/Users/jbloggs</code> (although the date portion will be the date that you did your install).</p>

<p>This applies to <a href="http://docs.info.apple.com/article.html?path=ServerAdmin/10.5/en/c7od45.html">network accounts which authenticate against Active Directory and do not have a mobile account</a>.</p>

<p>Why my place of work used to setup Macs with the option for create mobile account at login turned off is a mystery to me.</p>
]]></content:encoded>
			<wfw:commentRss>http://reliablybroken.com/b/2009/11/network-users-and-mac-10-5-archive-and-install/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Old-style Python class system and parent methods</title>
		<link>http://reliablybroken.com/b/2008/06/old-style-python-class-system-and-parent-methods/</link>
		<comments>http://reliablybroken.com/b/2008/06/old-style-python-class-system-and-parent-methods/#comments</comments>
		<pubDate>Mon, 09 Jun 2008 21:04:22 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[gotchas]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://reliablybroken.com/b/?p=8</guid>
		<description><![CDATA[I rather like Python&#8217;s explicit object reference requirement, whereby method definitions for a class instance have to use self as the first parameter (I should write some classes that use this instead of self some time, just to annoy myself).

But I was tripped up debugging a problem that centred on a simple class I had [...]]]></description>
			<content:encoded><![CDATA[<p>I rather like Python&#8217;s explicit object reference requirement, whereby method definitions for a class instance have to use <code>self</code> as the first parameter (I should write some classes that use <code>this</code> instead of <code>self</code> some time, just to annoy myself).</p>

<p>But I was tripped up debugging a problem that centred on a simple class I had that needed to do a bit of housekeeping for byte streams:</p>

<pre><code>from StringIO import StringIO

class MyString(StringIO):
    def __init__(self, *args, **kwargs):
        self._customized = True # Or similar housekeeping
        super(MyString, self).__init__(*args, **kwargs)
</code></pre>

<p>Creating an object from this class raises a <code>TypeError</code>:</p>

<pre><code>&gt;&gt;&gt; s = MyString()
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 4, in __init__
TypeError: super() argument 1 must be type, not classobj
</code></pre>

<p>Wuh? I always used <code>super</code> like that before, and it always worked. But my mistake here was I was sub-classing an <a href="http://docs.python.org/ref/node33.html"><em>old-style</em> class</a>, and <code>super</code> only works with <a href="http://docs.python.org/tut/node11.html#SECTION0011500000000000000000"><em>new-style</em> classes</a>.</p>

<p>The correct way of calling the parent method for old-style classes:</p>

<pre><code>class MyString(StringIO):
    def __init__(self, *args, **kwargs):
        self._customized = True # Or similar housekeeping
        StringIO.__init__(self, *args, **kwargs)
</code></pre>

<p>That works! But the distinction between the two class models is so inelegant, so clunky. It is a nasty bit of Python&#8217;s historic implementation that one needs to keep in mind, and it is knowledge that makes me no cleverer (although it does mean I&#8217;m less stupid than I was).</p>

<p>Of course Python 3000 removes this distinction&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://reliablybroken.com/b/2008/06/old-style-python-class-system-and-parent-methods/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
