classification
Title: Add PyLong_AsLongLongAndOverflow
Type: enhancement Stage: patch review
Components: Interpreter Core Versions: Python 3.2, Python 2.7
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: mark.dickinson Nosy List: casevh, mark.dickinson
Priority: normal Keywords: needs review, patch

Created on 2010-01-24 01:16 by casevh, last changed 2010-01-30 10:31 by mark.dickinson. This issue is now closed.

Files
File name Uploaded Description Edit
patch_longlong.diff casevh, 2010-01-24 01:16 Patch for PyLong_AsLongLongAndOverflow.
Messages (5)
msg98203 - (view) Author: Case Van Horsen (casevh) Date: 2010-01-24 01:16
There are "Long" and "LongLong" variants for most of the C API functions that work with PyLong. This patch adds a "LongLong" version of PyLong_AsLongAndOverflow.

This function will be helpful on 64-bit Windows platforms to quickly get a 64-bit integer or detect the need for multiple precision (or overflow). 

I can use this functionality for gmpy.
msg98539 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010-01-29 21:03
The proposed addition sounds entirely reasonable to me.

In your patch, is there a reason for leaving out the first PyInt_Check (compare with PyLong_AsLongAndOverflow)?
msg98547 - (view) Author: Case Van Horsen (casevh) Date: 2010-01-30 04:04
The missing PyInt_Check is a mistake. I probably thought I was working on a py3k version.

Let me know if I should create a new patch or if I should create one for py3k.

Thanks for the review.
msg98556 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010-01-30 08:43
Ok, great.  I'll add the PyInt_Check back in and commit the patch, then.  I just wanted to check that I wasn't missing something obvious.  Thank you!
msg98558 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010-01-30 10:31
Applied in r77842 (trunk), r77843 (py3k).
History
Date User Action Args
2010-01-30 10:31:14mark.dickinsonsetstatus: open -> closed
resolution: accepted
messages: + msg98558
2010-01-30 08:43:50mark.dickinsonsetmessages: + msg98556
2010-01-30 04:04:01casevhsetmessages: + msg98547
2010-01-29 21:03:48mark.dickinsonsetmessages: + msg98539
2010-01-24 09:14:56mark.dickinsonsetassignee: mark.dickinson

nosy: + mark.dickinson
2010-01-24 02:09:41brian.curtinsetpriority: normal
keywords: + needs review
versions: + Python 3.2
components: + Interpreter Core, - Extension Modules
stage: patch review
2010-01-24 01:16:47casevhcreate