[Python-Dev] Negative times behaviour in itertools.repeat for Python maintenance releases (2.7, 3.3 and maybe 3.4)
Ethan Furman
ethan at stoneleaf.us
Sat Feb 1 07:04:43 CET 2014
On 01/31/2014 07:23 PM, Larry Hastings wrote:
> On 01/28/2014 09:18 PM, Ethan Furman wrote:
>> On 01/28/2014 06:50 PM, Larry Hastings wrote:
>>> I think the "times behaves differently when passed by name versus passed by position" behavior falls exactly into this
>>> category, and its advice on how to handle it is sound.
>>
>> I don't agree with this. This is a bug. Somebody going through (for example) a code review and making minor changes
>> so the code is more readable shouldn't have to be afraid that [inserting | removing] the keyword in the function call
>> is going to *drastically* [1] change the behavior. I understand the need for a cycle of deprecation [2], but not
>> fixing it in 3.5 is folly.
>
> It's a bug. But it's also a longstanding bug, having been a part of Python since 2.7.
>
> Python is the language that cares about backwards-compatibility--bugs and all. If your code runs on version X.Y, it
> should run without modification on version X.(Y+Z) where Z is a positive integer.
So we only fix bugs that don't work at all? By which I mean, if the interpreter doesn't crash, we don't fix it?
> Therefore it would be inappropriate to remove the "times=-1 when passed by keyword repeats indefinitely" behavior
> without at /least/ a full deprecation cycle. Personally I'd prefer to leave the behavior in, undocumented and
> deprecated, until Python 4.0.
Well, at least we are agreed on a deprecation cycle. :)
--
~Ethan~
More information about the Python-Dev
mailing list