<div class="gmail_quote">On 13 December 2011 19:34, 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="im">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>
</div>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></blockquote><div> </div></div>But they aren't needed due to external dependencies if they're implementation-specific and not part of the API, no?