<?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: DictMixin</title>
	<atom:link href="http://blog.ianbicking.org/2007/08/17/dictmixin/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ianbicking.org/2007/08/17/dictmixin/</link>
	<description></description>
	<lastBuildDate>Wed, 08 Sep 2010 10:58:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Ian Bicking</title>
		<link>http://blog.ianbicking.org/2007/08/17/dictmixin/comment-page-1/#comment-193</link>
		<dc:creator>Ian Bicking</dc:creator>
		<pubDate>Fri, 17 Aug 2007 18:40:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ianbicking.org/2007/08/17/dictmixin/#comment-193</guid>
		<description>I&#039;m not exactly sure what you were doing.  `obj.__dict__` must be a real dictionary, I don&#039;t even think a dictionary subclass is okay.  But that&#039;s right at the heart of Python&#039;s objects, so it&#039;s not too surprising -- lots of low-level code pokes right into an instance&#039;s dictionary structure directly, I imagine.  I&#039;m *guessing* something along those lines is what happened to you with Storm?  There&#039;s also questions like &quot;can this object change behind my back?&quot; -- which you can feel more confident about with a real dictionary.  As an example, WSGI doesn&#039;t allow dictionary-like objects for requests, only exactly `dict`.  It&#039;s like a contract in that case.

You can do `class Foo(object, DictMixin):` if you want a new-style dict-like class; that works fine.</description>
		<content:encoded><![CDATA[<p>I&#8217;m not exactly sure what you were doing.  <code>obj.__dict__</code> must be a real dictionary, I don&#8217;t even think a dictionary subclass is okay.  But that&#8217;s right at the heart of Python&#8217;s objects, so it&#8217;s not too surprising &#8212; lots of low-level code pokes right into an instance&#8217;s dictionary structure directly, I imagine.  I&#8217;m <em>guessing</em> something along those lines is what happened to you with Storm?  There&#8217;s also questions like &#8220;can this object change behind my back?&#8221; &#8212; which you can feel more confident about with a real dictionary.  As an example, WSGI doesn&#8217;t allow dictionary-like objects for requests, only exactly <code>dict</code>.  It&#8217;s like a contract in that case.</p>

<p>You can do <code>class Foo(object, DictMixin):</code> if you want a new-style dict-like class; that works fine.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim</title>
		<link>http://blog.ianbicking.org/2007/08/17/dictmixin/comment-page-1/#comment-190</link>
		<dc:creator>Jim</dc:creator>
		<pubDate>Fri, 17 Aug 2007 11:45:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ianbicking.org/2007/08/17/dictmixin/#comment-190</guid>
		<description>DictMixin is handy.  But it&#039;s an old-style class, and I ran into difficulty when using it to store dictionary contents in a database with Storm because of that.  This led me to the #storm IRC channel, where I was told simply that what I was doing wasn&#039;t a proper dictionary and therefore I should use an over-complicated delegation system instead.  Ugh.

I can&#039;t see the point of that.  Yes, a class using DictMixin can do some clever stuff behind the scenes that you wouldn&#039;t necessarily expect from a normal dictionary.  But that doesn&#039;t mean that it isn&#039;t actually a dictionary, does it?  It still stores key/value pairs, right?

I think adapting simple interfaces like the Dict interface to complex behaviour is one of the things that makes Python so useful.  I don&#039;t see the problem with &quot;magic&quot; like this, in fact I think it&#039;s a great thing.  What do you say to people who want to double your class-count for the sake of it?  Telling them to go back to Java sounds too snotty, but their attitude isn&#039;t great either.</description>
		<content:encoded><![CDATA[<p>DictMixin is handy.  But it&#8217;s an old-style class, and I ran into difficulty when using it to store dictionary contents in a database with Storm because of that.  This led me to the #storm IRC channel, where I was told simply that what I was doing wasn&#8217;t a proper dictionary and therefore I should use an over-complicated delegation system instead.  Ugh.</p>

<p>I can&#8217;t see the point of that.  Yes, a class using DictMixin can do some clever stuff behind the scenes that you wouldn&#8217;t necessarily expect from a normal dictionary.  But that doesn&#8217;t mean that it isn&#8217;t actually a dictionary, does it?  It still stores key/value pairs, right?</p>

<p>I think adapting simple interfaces like the Dict interface to complex behaviour is one of the things that makes Python so useful.  I don&#8217;t see the problem with &#8220;magic&#8221; like this, in fact I think it&#8217;s a great thing.  What do you say to people who want to double your class-count for the sake of it?  Telling them to go back to Java sounds too snotty, but their attitude isn&#8217;t great either.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Neumann</title>
		<link>http://blog.ianbicking.org/2007/08/17/dictmixin/comment-page-1/#comment-189</link>
		<dc:creator>Michael Neumann</dc:creator>
		<pubDate>Fri, 17 Aug 2007 08:32:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.ianbicking.org/2007/08/17/dictmixin/#comment-189</guid>
		<description>I wrote a Ruby version of your FSDict class. It&#039;s here: http://blog.ntecs.de/articles/2007/08/17/ian-bickings-fsdict-in-ruby</description>
		<content:encoded><![CDATA[<p>I wrote a Ruby version of your FSDict class. It&#8217;s here: <a href="http://blog.ntecs.de/articles/2007/08/17/ian-bickings-fsdict-in-ruby" rel="nofollow">http://blog.ntecs.de/articles/2007/08/17/ian-bickings-fsdict-in-ruby</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.705 seconds -->
