New submission from Serhiy Storchaka:

>>> ba = bytearray(b'ab')
>>> it = iter(ba)
>>> next(it)
97
>>> ba.clear()
>>> list(it)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: __length_hint__() should return >= 0

Proposed patch fixes this issue.

----------
components: Interpreter Core
files: bytearray_iterator_length_hint.patch
keywords: patch
messages: 269729
nosy: rhettinger, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: __length_hint__() of bytearray iterator can return negative integer
type: behavior
versions: Python 3.5, Python 3.6
Added file: 
http://bugs.python.org/file43612/bytearray_iterator_length_hint.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27443>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to