Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PyLong_AsLongLongAndOverflow #52015

Closed
casevh mannequin opened this issue Jan 24, 2010 · 5 comments
Closed

Add PyLong_AsLongLongAndOverflow #52015

casevh mannequin opened this issue Jan 24, 2010 · 5 comments
Assignees
Labels
interpreter-core Interpreter core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@casevh
Copy link
Mannequin

casevh mannequin commented Jan 24, 2010

BPO 7767
Nosy @mdickinson
Files
  • patch_longlong.diff: Patch for PyLong_AsLongLongAndOverflow.
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/mdickinson'
    closed_at = <Date 2010-01-30.10:31:14.484>
    created_at = <Date 2010-01-24.01:16:47.643>
    labels = ['interpreter-core', 'type-feature']
    title = 'Add PyLong_AsLongLongAndOverflow'
    updated_at = <Date 2010-01-30.10:31:14.475>
    user = 'https://bugs.python.org/casevh'

    bugs.python.org fields:

    activity = <Date 2010-01-30.10:31:14.475>
    actor = 'mark.dickinson'
    assignee = 'mark.dickinson'
    closed = True
    closed_date = <Date 2010-01-30.10:31:14.484>
    closer = 'mark.dickinson'
    components = ['Interpreter Core']
    creation = <Date 2010-01-24.01:16:47.643>
    creator = 'casevh'
    dependencies = []
    files = ['15985']
    hgrepos = []
    issue_num = 7767
    keywords = ['patch', 'needs review']
    message_count = 5.0
    messages = ['98203', '98539', '98547', '98556', '98558']
    nosy_count = 2.0
    nosy_names = ['mark.dickinson', 'casevh']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = 'patch review'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue7767'
    versions = ['Python 2.7', 'Python 3.2']

    @casevh
    Copy link
    Mannequin Author

    casevh mannequin commented Jan 24, 2010

    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.

    @casevh casevh mannequin added extension-modules C modules in the Modules dir type-feature A feature request or enhancement labels Jan 24, 2010
    @briancurtin briancurtin added interpreter-core Interpreter core (Objects, Python, Grammar, and Parser dirs) and removed extension-modules C modules in the Modules dir labels Jan 24, 2010
    @mdickinson mdickinson self-assigned this Jan 24, 2010
    @mdickinson
    Copy link
    Member

    mdickinson commented Jan 29, 2010

    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)?

    @casevh
    Copy link
    Mannequin Author

    casevh mannequin commented Jan 30, 2010

    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.

    @mdickinson
    Copy link
    Member

    mdickinson commented Jan 30, 2010

    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!

    @mdickinson
    Copy link
    Member

    mdickinson commented Jan 30, 2010

    Applied in r77842 (trunk), r77843 (py3k).

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    interpreter-core Interpreter core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants