Skip to content

Commit

Permalink
Issue python#28376: The type of long range iterator is now registered…
Browse files Browse the repository at this point in the history
… as Iterator.

Patch by Oren Milman.
  • Loading branch information
serhiy-storchaka committed Oct 8, 2016
1 parent 44759bc commit 48b1c3f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Lib/_collections_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
list_iterator = type(iter([]))
list_reverseiterator = type(iter(reversed([])))
range_iterator = type(iter(range(0)))
longrange_iterator = type(iter(range(1 << 1000)))
set_iterator = type(iter(set()))
str_iterator = type(iter(""))
tuple_iterator = type(iter(()))
Expand Down Expand Up @@ -234,6 +235,7 @@ def __subclasshook__(cls, C):
Iterator.register(list_iterator)
Iterator.register(list_reverseiterator)
Iterator.register(range_iterator)
Iterator.register(longrange_iterator)
Iterator.register(set_iterator)
Iterator.register(str_iterator)
Iterator.register(tuple_iterator)
Expand Down
3 changes: 3 additions & 0 deletions Misc/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ Release date: TBA
Core and Builtins
-----------------

- Issue #28376: The type of long range iterator is now registered as Iterator.
Patch by Oren Milman.

- Issue #28376: The constructor of range_iterator now checks that step is not 0.
Patch by Oren Milman.

Expand Down

0 comments on commit 48b1c3f

Please sign in to comment.