<div class="gmail_quote">On 13 December 2011 19:54, Ian Kelly <span dir="ltr"><<a href="mailto:ian.g.kelly@gmail.com">ian.g.kelly@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On Tue, Dec 13, 2011 at 12:43 PM, Joshua Landau<br>
<<a href="mailto:joshua.landau.ws@gmail.com">joshua.landau.ws@gmail.com</a>> wrote:<br>
> On 13 December 2011 19:34, Ian Kelly <<a href="mailto:ian.g.kelly@gmail.com">ian.g.kelly@gmail.com</a>> wrote:<br>
>><br>
>> On Tue, Dec 13, 2011 at 1:34 AM, Joshua Landau<br>
>> <<a href="mailto:joshua.landau.ws@gmail.com">joshua.landau.ws@gmail.com</a>> wrote:<br>
>> >> No, there is another difference, the reason for rebinding the name.<br>
>> >> In a subclass, you would rebind a class attribute because that<br>
>> >> particular attribute, which you need to change, is used and expected<br>
>> >> by external code, either in the base class or in code that uses its<br>
>> >> API (or both). Local variables in functions, on the other hand, are<br>
>> >> not externally visible, so there is no need to do this in order to<br>
>> >> conform to the expectations of external code. All it does in that<br>
>> >> case is to sow potential confusion.<br>
>> >><br>
>> > So you're saying you should never extend methods or attributes that<br>
>> > aren't meant to be used as part of of the API? Because I can claim<br>
>> > guilty on this point.<br>
>><br>
>> No, I'm only saying that replacing attributes in subclasses is<br>
>> accepted because it is necessary due to external dependencies, and<br>
>> that local variables in functions don't have that excuse.<br>
><br>
><br>
> But they aren't needed due to external dependencies if they're<br>
> implementation-specific and not part of the API, no?<br>
<br>
</div></div>By "external dependencies" I mean anything that's not specifically<br>
part of the subclass. This includes the base class. If they're not<br>
part of the API, then the base class presumably uses them for<br>
something, and by replacing them, you change the behavior of that base<br>
functionality. That's an external dependency.<br></blockquote><div> </div></div>Touché. On this point, I yield.