New submission from Mark Dickinson:
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.
----------
components: Interpreter Core
messages: 282402
nosy: mark.dickinson
priority: normal
severity: normal
status: open
title: bool of large range raises OverflowError
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue28876>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com