<?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: Overriding Operators in New-Style Classes</title>
	<atom:link href="http://mathieu.fenniak.net/overriding-operators-in-new-style-classes/feed/" rel="self" type="application/rss+xml" />
	<link>http://mathieu.fenniak.net/overriding-operators-in-new-style-classes/</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Tue, 31 Mar 2009 04:37:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Ian Bicking</title>
		<link>http://mathieu.fenniak.net/overriding-operators-in-new-style-classes/comment-page-1/#comment-26</link>
		<dc:creator>Ian Bicking</dc:creator>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://stompstompstomp.com/weblog/entries/71#comment-26</guid>
		<description>No -- I think you&#039;re close to having it work.  But what you are doing in __init__ now, you have to do in the metaclass.  And you have to turn Operator into a descriptor, with a __get__ that binds the instance (as opposed to now, where you are binding the instance in __init__).  I don&#039;t know it well enough to do it off the top of my head, but it&#039;s not many more lines of code than you have already.



You could also probably do it with a metaclass, lambda, and default arguments.</description>
		<content:encoded><![CDATA[<p>No &#8212; I think you&#8217;re close to having it work.  But what you are doing in __init__ now, you have to do in the metaclass.  And you have to turn Operator into a descriptor, with a __get__ that binds the instance (as opposed to now, where you are binding the instance in __init__).  I don&#8217;t know it well enough to do it off the top of my head, but it&#8217;s not many more lines of code than you have already.</p>
<p>You could also probably do it with a metaclass, lambda, and default arguments.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lao</title>
		<link>http://mathieu.fenniak.net/overriding-operators-in-new-style-classes/comment-page-1/#comment-27</link>
		<dc:creator>Lao</dc:creator>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://stompstompstomp.com/weblog/entries/71#comment-27</guid>
		<description>Well, color me corrected.  For one reason or another, I had never thought of using a descriptor.  This made it impossible to setup a metaclass, since I needed access to the instance object _and_ the operator information at a later time.  With your helpful suggestion, it was pretty easy to adjust the code to work properly - my entire matrix test suite ran as soon as I finished typing.



Thanks, I&#039;ll be posting an update to this in a few minutes.</description>
		<content:encoded><![CDATA[<p>Well, color me corrected.  For one reason or another, I had never thought of using a descriptor.  This made it impossible to setup a metaclass, since I needed access to the instance object _and_ the operator information at a later time.  With your helpful suggestion, it was pretty easy to adjust the code to work properly &#8211; my entire matrix test suite ran as soon as I finished typing.</p>
<p>Thanks, I&#8217;ll be posting an update to this in a few minutes.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
