Skip to content

PyLong_ API cleanup #76619

Closed
Closed

Description

@embray
BPO 32438
Nosy @malemburg, @mdickinson, @embray, @serhiy-storchaka, @isidentical
Superseder
  • bpo-36048: Deprecate implicit truncating when convert Python numbers to C integers: use index, not int
  • 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 = None
    closed_at = <Date 2019-12-28.12:44:53.965>
    created_at = <Date 2017-12-28.10:19:25.125>
    labels = ['interpreter-core', 'type-bug', '3.7']
    title = 'PyLong_ API cleanup'
    updated_at = <Date 2019-12-28.12:44:53.964>
    user = 'https://github.com/embray'

    bugs.python.org fields:

    activity = <Date 2019-12-28.12:44:53.964>
    actor = 'mark.dickinson'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-12-28.12:44:53.965>
    closer = 'mark.dickinson'
    components = ['Interpreter Core']
    creation = <Date 2017-12-28.10:19:25.125>
    creator = 'erik.bray'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 32438
    keywords = []
    message_count = 5.0
    messages = ['309119', '309136', '358934', '358942', '358944']
    nosy_count = 6.0
    nosy_names = ['lemburg', 'mark.dickinson', 'stutzbach', 'erik.bray', 'serhiy.storchaka', 'BTaskaya']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '36048'
    type = 'behavior'
    url = 'https://bugs.python.org/issue32438'
    versions = ['Python 3.7']

    Activity

    1. embray commented on Dec 28, 2017

      @embray
      ContributorAuthor

      Per Serhiy's comment in this thread https://mail.python.org/pipermail/python-ideas/2017-December/048413.html (which I agree with), several of the PyLong_ functions have behavior carried over from Python 2 of calling __int__ on their arguments if the input is not a PyLongObject:

      PyLong_AsLong
      PyLong_AsLongAndOverflow
      PyLong_AsLongLong
      PyLong_AsLongLongAndOverflow
      PyLong_AsUnsignedLongMask
      PyLong_AsUnsignedLongLongMask

      This behavior should probably be deprecated, and eventually removed. Interfaces that should accept generic number-like objects should use the PyNumber API instead.

    2. added
      interpreter-core
      type-bug
      on Dec 28, 2017
    3. serhiy-storchaka commented on Dec 28, 2017

      @serhiy-storchaka
      Member

      See also bpo-17576. And there may be other related issues.

    4. isidentical commented on Dec 28, 2019

      @isidentical
      SponsorMember

      Is this related/resolved with bpo-36048?

    5. mdickinson commented on Dec 28, 2019

      @mdickinson
      Member

      @batuhan: I think so, yes; at least, the "deprecated" part is done. The "eventually removed" is not, and I don't know whether we have a target version for that removal.

    6. mdickinson commented on Dec 28, 2019

      @mdickinson
      Member

      Closing as a duplicate of bpo-36048 (which isn't quite right, since this issue came first, but it's probably close enough).

    7. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.7 (EOL)interpreter-coretype-bug

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions