On Sun, Jan 26, 2014 at 11:26 PM, Vajrasky Kok <sky....@speaklikeaking.com>wrote:
> In case we are taking "not backporting anything at all" road, what is > the best fix for the document? > > Old > >>> itertools.repeat.__doc__ > 'repeat(object [,times]) -> create an iterator which returns the > object\nfor the specified number of times. If not specified, returns > the object\nendlessly.' > I would say no fix is needed for this doc because the signature suggests (correctly) that passing times by keyword is not supported. The following behavior further supports this interpretation. >>> from itertools import * >>> ''.join(repeat('a', times=-4)) Traceback (most recent call last): File "<stdin>", line 1, in <module> OverflowError: long int too large to convert to int The ReST documentation may benefit from an addition of a warning that behavior of repeat() is "undefined" when times is passed by keyword.
_______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com