<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Aug 23, 2011, at 10:37 AM, Tobias Oberstein wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Menlo; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="font-family: monospace; ">class AutobahnDeferred(Deferred):<br>&nbsp;&nbsp;def call(self, *args):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return self.addCallback(self.protocol.rcall, *args)<br><br>Pro:<span class="Apple-tab-span" style="white-space: pre; ">        </span>most terse<br>Con:<span class="Apple-tab-span" style="white-space: pre; ">        </span>only supports single callback no errback<br></span></span></blockquote></div><br><div>Con: subclassing in general is a bad idea. &nbsp;Subclassing Deferred is an even worse idea. &nbsp;What if Deferred one day gets a new method called 'call' that does something different? &nbsp;Your code would all break.</div><div><br></div><div><blockquote type="cite"><span class="Apple-style-span" style="font-family: monospace; ">Anything why I shouldn't do?</span><span class="Apple-style-span" style="font-family: monospace; "><br></span></blockquote><br></div><div>Providing three different ways to do the same thing just so that you can use different syntax depending on your mood is a recipe for making your code hard to read. &nbsp;Pick one style, stick to it as much as possible - consistency is more important than the benefits of any one particular style :).</div><div><br></div><div>(Except the subclassing one. &nbsp;Don't do that.)</div><div><br></div><div>-glyph</div><div><br></div></body></html>