Message339626
> 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. |
|
Date |
User |
Action |
Args |
2019-04-08 11:54:52 | methane | set | recipients:
+ methane, ronaldoussoren, ncoghlan, serhiy.storchaka, Aaron Hall, anthony shaw |
2019-04-08 11:54:52 | methane | link | issue36551 messages |
2019-04-08 11:54:52 | methane | create | |
|