
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2016-12-05 09:37 bymark.dickinson, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| range_bool.patch | akira,2016-12-05 12:27 | |||
| range_bool-no_docs.patch | akira,2016-12-06 07:50 | no docs updates | ||
| range_bool-c99-designated-initializers.patch | akira,2017-01-22 13:17 | use c99 designated initializers | ||
| range_bool-c99-designated-initializers-indent.patch | akira,2017-01-23 15:00 | use 4-space indent, space around "=" | ||
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 699 | merged | akira,2017-03-17 19:31 | |
| PR 734 | merged | serhiy.storchaka,2017-03-20 06:48 | |
| PR 735 | merged | serhiy.storchaka,2017-03-20 07:13 | |
| Messages (18) | |||
|---|---|---|---|
| msg282402 -(view) | Author: Mark Dickinson (mark.dickinson)*![]() | Date: 2016-12-05 09:37 | |
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_tThis 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. | |||
| msg282405 -(view) | Author: Raymond Hettinger (rhettinger)*![]() | Date: 2016-12-05 09:54 | |
+1 for implementing nb_bool for range objects. | |||
| msg282414 -(view) | Author: Akira Li (akira)* | Date: 2016-12-05 12:27 | |
Here's a patch with range_bool() implementation, tests and the docs update.I'm not sure how it should be documented. I've specified it as versionchanged:: 3.6 | |||
| msg282418 -(view) | Author: Mark Dickinson (mark.dickinson)*![]() | Date: 2016-12-05 13:13 | |
> I'm not sure how it should be documented.I think a change at this level probably isn't worth documenting in the official docs; it's enough that there's aMisc/NEWS entry for it. | |||
| msg282506 -(view) | Author: Akira Li (akira)* | Date: 2016-12-06 07:50 | |
I've removed the documentation changes from the patch. | |||
| msg283137 -(view) | Author: Mark Dickinson (mark.dickinson)*![]() | Date: 2016-12-13 19:46 | |
Patch LGTM. You could safely drop the initialisers beyond `nb_bool` in the `range_as_number` struct (per C99 6.7.8p21), but it's fine as it is. | |||
| msg286008 -(view) | Author: Akira Li (akira)* | Date: 2017-01-22 13:17 | |
Following the python-dev discussion [1] I've added a variant of the patch that uses c99 designated initializers [2][1]https://mail.python.org/pipermail/python-dev/2017-January/147175.html[2]https://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html | |||
| msg286048 -(view) | Author: Raymond Hettinger (rhettinger)*![]() | Date: 2017-01-23 05:50 | |
This patch looks ready to go. I'll wait a bit to see it there are any other comments. If not, I'll apply it shortly. | |||
| msg286055 -(view) | Author: Inada Naoki (methane)*![]() | Date: 2017-01-23 07:32 | |
LGTM, except 2-space indent. | |||
| msg286089 -(view) | Author: Akira Li (akira)* | Date: 2017-01-23 15:00 | |
I've updated the patch to use 4-space indent (pep-7).I've added space around "=" (pep-7); unlike the usual"dict(designator=value)" -- no space around "=" for keyword argument(pep-8). | |||
| msg286092 -(view) | Author: Mark Dickinson (mark.dickinson)*![]() | Date: 2017-01-23 16:15 | |
Latest patch LGTM too. | |||
| msg289772 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2017-03-17 17:27 | |
Akira, could you open a pull request on GitHub? | |||
| msg289778 -(view) | Author: Akira Li (akira)* | Date: 2017-03-17 19:40 | |
> Akira, could you open a pull request on GitHub?Done.PR 699 | |||
| msg289786 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2017-03-17 21:09 | |
Inissue29840 proposed an alternate and more general solution. But I think that nb_bool should be implemented for range objects sinceissue29840 is 3.7 only and nb_bool is faster. | |||
| msg289876 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2017-03-20 07:39 | |
Thank you Akira for your patch. | |||
| msg290129 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2017-03-24 20:18 | |
New changeset4276068fe57e93b4c8d428f0b1cde8ca04b8fb99 by Serhiy Storchaka in branch '3.5':bpo-28876: bool of large range raises OverflowError (#699) (#735)https://github.com/python/cpython/commit/4276068fe57e93b4c8d428f0b1cde8ca04b8fb99 | |||
| msg290130 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2017-03-24 20:18 | |
New changeset6fad4090ec9a27f8572bb00661b9890f01fb62f7 by Serhiy Storchaka in branch '3.6':bpo-28876: bool of large range raises OverflowError (#699) (#734)https://github.com/python/cpython/commit/6fad4090ec9a27f8572bb00661b9890f01fb62f7 | |||
| msg290132 -(view) | Author: Serhiy Storchaka (serhiy.storchaka)*![]() | Date: 2017-03-24 20:18 | |
New changesete46fb8611867fa3b407a813f53137929b7cb4a10 by Serhiy Storchaka (4kir4) in branch 'master':bpo-28876: bool of large range raises OverflowError (#699)https://github.com/python/cpython/commit/e46fb8611867fa3b407a813f53137929b7cb4a10 | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:40 | admin | set | github: 73062 |
| 2017-03-24 20:18:43 | serhiy.storchaka | set | messages: +msg290132 |
| 2017-03-24 20:18:24 | serhiy.storchaka | set | messages: +msg290130 |
| 2017-03-24 20:18:15 | serhiy.storchaka | set | messages: +msg290129 |
| 2017-03-20 07:39:08 | serhiy.storchaka | set | status: open -> closed resolution: fixed messages: +msg289876 stage: patch review -> resolved |
| 2017-03-20 07:13:20 | serhiy.storchaka | set | pull_requests: +pull_request649 |
| 2017-03-20 06:48:06 | serhiy.storchaka | set | pull_requests: +pull_request648 |
| 2017-03-17 21:09:22 | serhiy.storchaka | set | messages: +msg289786 stage: needs patch -> patch review |
| 2017-03-17 19:40:39 | akira | set | messages: +msg289778 |
| 2017-03-17 19:31:41 | akira | set | pull_requests: +pull_request572 |
| 2017-03-17 17:27:35 | serhiy.storchaka | set | messages: +msg289772 |
| 2017-03-17 08:36:16 | serhiy.storchaka | link | issue29833 dependencies |
| 2017-01-23 16:15:21 | mark.dickinson | set | messages: +msg286092 |
| 2017-01-23 15:00:58 | akira | set | files: +range_bool-c99-designated-initializers-indent.patch messages: +msg286089 |
| 2017-01-23 07:32:28 | methane | set | nosy: +methane messages: +msg286055 |
| 2017-01-23 05:50:15 | rhettinger | set | assignee:rhettinger messages: +msg286048 |
| 2017-01-22 13:17:19 | akira | set | files: +range_bool-c99-designated-initializers.patch messages: +msg286008 |
| 2016-12-13 19:46:41 | mark.dickinson | set | messages: +msg283137 |
| 2016-12-06 07:50:44 | akira | set | files: +range_bool-no_docs.patch messages: +msg282506 |
| 2016-12-05 13:13:09 | mark.dickinson | set | messages: +msg282418 |
| 2016-12-05 12:27:37 | akira | set | files: +range_bool.patch nosy: +akira messages: +msg282414 keywords: +patch |
| 2016-12-05 10:47:43 | serhiy.storchaka | set | nosy: +serhiy.storchaka stage: needs patch |
| 2016-12-05 09:54:59 | rhettinger | set | nosy: +rhettinger messages: +msg282405 |
| 2016-12-05 09:37:42 | mark.dickinson | create | |