<div dir="ltr">I think "s<span style="font-size:12.8px">pecial </span><span style="font-size:12.8px">cases aren't special enough to break the rules" make this a -1, there's no reason for the behaviour change besides enabling bad code.</span></div><div class="gmail_extra"><br><div class="gmail_quote">On 4 May 2016 at 11:48, Paul Moore <span dir="ltr"><<a href="mailto:p.f.moore@gmail.com" target="_blank">p.f.moore@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 4 May 2016 at 10:05, Rob Cliffe <<a href="mailto:rob.cliffe@btinternet.com">rob.cliffe@btinternet.com</a>> wrote:<br>
>> Either fix it all the way or don't bother. The rule "duplicates are allowed" or<br>
>> "duplicates are not allowed" is much simpler and easier to remember than<br>
>> "duplicates are allowed except when..." or, contrariwise, "duplicates are not<br>
>> allowed unless ...".<br>
><br>
> I disagree, on the grounds that 'practicality beats purity' (sorry to repeat<br>
> myself).<br>
> Here's a thought.<br>
> We are rightly concerned with changes breaking existing code.<br>
> The proposed change could lead to some existing code being *repaired*, by<br>
> pointing out a mistake that the author doesn't know is there.<br>
<br>
</span>The problem is that it could also break code that works at the moment.<br>
Consider a mapping of constants to names:<br>
<br>
colors = {<br>
RED: "Red",<br>
BLUE: "Blue",<br>
PINK: "Pink",<br>
LIGHT_BLUE: "Light Blue",<br>
DARK_BLUE: "Dark Blue",<br>
}<br>
<br>
On a certain output device, there may be no "light blue", and in that<br>
case the code sets LIGHT_BLUE = BLUE. That's entirely reasonable, and<br>
the author may be perfectly happy with the current behavior in that<br>
case.<br>
<br>
So I think it's important for backward compatibility that this change<br>
be *only* for the case of literal values as keys (which is what the OP<br>
proposed, of course). And given that it needs to just be for literal<br>
values as keys, I personally think that makes it a case of "Special<br>
cases aren't special enough to break the rules", so I'm -0 on the<br>
proposal (I don't think it's a *bad* thing, in the constants-only<br>
form, just that it's not worth the effort - but if someone else makes<br>
the effort, I won't object).<br>
<span class="HOEnZb"><font color="#888888"><br>
Paul<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/codeofconduct/</a><br>
</div></div></blockquote></div><br></div>