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

No longer use implicit convertion to int with loss #82180

Closed
serhiy-storchaka opened this issue Sep 1, 2019 · 6 comments
Closed

No longer use implicit convertion to int with loss #82180

serhiy-storchaka opened this issue Sep 1, 2019 · 6 comments
Labels
3.10 interpreter-core type-feature

Comments

@serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Sep 1, 2019

BPO 37999
Nosy @mdickinson, @serhiy-storchaka, @hpjansson
PRs
  • #15636
  • #20437
  • #20449
  • #17536
  • 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 2020-05-28.08:12:43.571>
    created_at = <Date 2019-09-01.11:24:04.696>
    labels = ['interpreter-core', 'type-feature', '3.10']
    title = 'No longer use implicit convertion to int with loss'
    updated_at = <Date 2020-07-01.19:01:56.267>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2020-07-01.19:01:56.267>
    actor = 'hpj'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-05-28.08:12:43.571>
    closer = 'serhiy.storchaka'
    components = ['Interpreter Core']
    creation = <Date 2019-09-01.11:24:04.696>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 37999
    keywords = ['patch']
    message_count = 6.0
    messages = ['350947', '370004', '370063', '370072', '370173', '372622']
    nosy_count = 3.0
    nosy_names = ['mark.dickinson', 'serhiy.storchaka', 'hpj']
    pr_nums = ['15636', '20437', '20449', '17536']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue37999'
    versions = ['Python 3.10']

    @serhiy-storchaka
    Copy link
    Member Author

    @serhiy-storchaka serhiy-storchaka commented Sep 1, 2019

    Use only the __index__() method for implicit conversion to iteger, and not __int__().

    This converts deprecation warnings added in bpo-36048 into TypeError.

    @serhiy-storchaka serhiy-storchaka added interpreter-core type-feature labels Sep 1, 2019
    @serhiy-storchaka
    Copy link
    Member Author

    @serhiy-storchaka serhiy-storchaka commented May 26, 2020

    New changeset 578c395 by Serhiy Storchaka in branch 'master':
    bpo-37999: No longer use __int__ in implicit integer conversions. (GH-15636)
    578c395

    @mdickinson
    Copy link
    Member

    @mdickinson mdickinson commented May 27, 2020

    There are some comments in the Objects/longobject.c code that still refer to __int__, and could use an update.

    For example:

    /* Get a C long int from an int object or any object that has an __int__

    @mdickinson
    Copy link
    Member

    @mdickinson mdickinson commented May 27, 2020

    New changeset 20941de by Mark Dickinson in branch 'master':
    bpo-37999: Fix outdated __int__ and nb_int references in comments (GH-20449)
    20941de

    @serhiy-storchaka
    Copy link
    Member Author

    @serhiy-storchaka serhiy-storchaka commented May 28, 2020

    I think it is all here. Thank you Mark for your review and for fixing outdated docs and comments.

    @serhiy-storchaka
    Copy link
    Member Author

    @serhiy-storchaka serhiy-storchaka commented Jun 29, 2020

    New changeset e67f7db by Serhiy Storchaka in branch 'master':
    bpo-37999: Simplify the conversion code for %c, %d, %x, etc. (GH-20437)
    e67f7db

    @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
    3.10 interpreter-core type-feature
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants