Message282402
The bool of a large range raises OverflowError:
>>> bool(range(2**63))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: Python int too large to convert to C ssize_t
This is a side-effect of len raising OverflowError, which is a general problem that's nontrivial to fix (the sq_length slot is constrained to return a ssize_t). In theory, though, it would be possible to implement nb_bool for range objects to do the right thing.
In practice, this may well not be worth fixing, though I think it's at least worth reporting. |
|
Date |
User |
Action |
Args |
2016-12-05 09:37:42 | mark.dickinson | set | recipients:
+ mark.dickinson |
2016-12-05 09:37:42 | mark.dickinson | set | messageid: <1480930662.45.0.497603219066.issue28876@psf.upfronthosting.co.za> |
2016-12-05 09:37:42 | mark.dickinson | link | issue28876 messages |
2016-12-05 09:37:41 | mark.dickinson | create | |
|