Inada Naoki <songofaca...@gmail.com> added the comment: > Try > > [x for x in range(2**1000)] > > in a REPL. It doesn’t raise anything, it tries to create a list that will > eventually exceed PY_SIZE_MAX, but it only crashes once it reaches that > iteration.
It is expected behavior. > This raises an OverflowError instead, the same way: > len(range(2**1000)) > raises an OverflowError If your patch uses __length_hint__, it is bug. iterator will return 2**1000 for __length_hint__, but produce no item on iteration. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue36551> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com