[issue25926] problems with "times" keyword in itertools.repeat

2016-05-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f66c30f66235 by Raymond Hettinger in branch '2.7':
Issue 25926:  Clarify that the pure python equivalents are only approximate.
https://hg.python.org/cpython/rev/f66c30f66235

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25926] problems with "times" keyword in itertools.repeat

2016-05-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 613314c3f9ed by Raymond Hettinger in branch '3.5':
Issue 25926:  Clarify that the pure python equivalents are only approximate.
https://hg.python.org/cpython/rev/613314c3f9ed

New changeset e67e970de54a by Raymond Hettinger in branch 'default':
Issue 25926:  Clarify that the pure python equivalents are only approximate.
https://hg.python.org/cpython/rev/e67e970de54a

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25926] problems with "times" keyword in itertools.repeat

2016-05-27 Thread Nofar Schnider

Nofar Schnider added the comment:

Attached a diff
All occurrences of "equivalent to" are switched to "roughly equivalent to"

--
hgrepos: +345
keywords: +patch
Added file: http://bugs.python.org/file43026/issue25926.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25926] problems with "times" keyword in itertools.repeat

2016-05-27 Thread Nofar Schnider

Changes by Nofar Schnider :


Removed file: http://bugs.python.org/file43025/itertools.rst

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25926] problems with "times" keyword in itertools.repeat

2016-05-27 Thread Nofar Schnider

Nofar Schnider added the comment:

Issue #25926
Changed all "equivalent to" occurrences to "roughly equivalent to"

--
hgrepos: +344
nosy: +Nofar Schnider
Added file: http://bugs.python.org/file43025/itertools.rst

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25926] problems with "times" keyword in itertools.repeat

2016-05-18 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I'm okay with changing the docs to "roughly equivalent to".  That will help 
prevent the occasional misreading as "precisely equivalent in every respect".

--
priority: normal -> low

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25926] problems with "times" keyword in itertools.repeat

2016-05-18 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25926] problems with "times" keyword in itertools.repeat

2016-05-18 Thread Camilla Montonen

Camilla Montonen added the comment:

Should 'roughly equivalent to' be added as a note to the docs?

--
nosy: +Winterflower

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25926] problems with "times" keyword in itertools.repeat

2015-12-22 Thread Thomas Feldmann

New submission from Thomas Feldmann:

According to the docs `itertools.repeat(object[, times])` is equivalent to

```
def repeat(object, times=None):
# repeat(10, 3) --> 10 10 10
if times is None:
while True:
yield object
else:
for i in range(times):
yield object
```

But it raises a TypeError when used this way:

```
Python 3.5.1 (default, Dec 10 2015, 10:34:07)
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.1.76)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from itertools import repeat
>>> repeat('x', times=None)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'NoneType' object cannot be interpreted as an integer
```

The `times` keyword can be omitted but not explicitly set to None.
I checked with Python Versions 2.7 and 3.5.1 on Mac OS X and Windows 10.

--
components: Interpreter Core
messages: 256847
nosy: Thomas Feldmann
priority: normal
severity: normal
status: open
title: problems with "times" keyword in itertools.repeat
type: behavior
versions: Python 2.7, Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25926] problems with "times" keyword in itertools.repeat

2015-12-22 Thread R. David Murray

R. David Murray added the comment:

Huh.  I always thought the wording was "roughly equivalent to".  This is a 
consequence of C vs python, and is the reason the docstring uses the [] 
notation.

--
nosy: +r.david.murray, rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com