This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2016年12月17日 09:37 by serhiy.storchaka, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| py2_int_long.diff | serhiy.storchaka, 2016年12月17日 09:48 | review | ||
| py2_int_long_2.diff | serhiy.storchaka, 2016年12月25日 09:39 | review | ||
| Messages (3) | |||
|---|---|---|---|
| msg283479 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2016年12月17日 09:37 | |
Since implementing PEP 237 (Unifying Long Integers and Integers) in Python 2.4 int and long instances became interchangeable. Virtually any function that needs an integer, accepts both int and long. But there are few places where only int is accepted. Since it is easy unintentionally convert int to long (add and subtract large int, or add 0L), this can lead to subtle errors in rare circumstances. Proposed patch makes few places that accepted only int accepting long too. This mainly is changing isinstance(x, int) to isinstance(x, (int, long)). |
|||
| msg283990 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2016年12月25日 09:39 | |
Added checks for errors in C code (they are needed even without supporting Python longs, PyInt_AsLong() can fail with Python ints) and a fast path for Python longs in PyInt_AsLong() (avoid creating temporary Python int). |
|||
| msg284093 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2016年12月27日 13:09 | |
New changeset ffcb321ba9c0 by Serhiy Storchaka in branch '2.7': Issue #28998: More APIs now support longs as well as ints. https://hg.python.org/cpython/rev/ffcb321ba9c0 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:40 | admin | set | github: 73184 |
| 2016年12月27日 13:10:23 | serhiy.storchaka | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2016年12月27日 13:09:56 | python-dev | set | nosy:
+ python-dev messages: + msg284093 |
| 2016年12月25日 09:40:01 | serhiy.storchaka | set | files:
+ py2_int_long_2.diff assignee: serhiy.storchaka messages: + msg283990 |
| 2016年12月17日 09:48:42 | serhiy.storchaka | set | files:
+ py2_int_long.diff keywords: + patch |
| 2016年12月17日 09:37:38 | serhiy.storchaka | create | |