Skip to content

Deprecate implicit truncating when convert Python numbers to C integers: use __index__, not __int__ #80229

@serhiy-storchaka

Description

@serhiy-storchaka
BPO 36048
Nosy @gvanrossum, @mdickinson, @vstinner, @serhiy-storchaka, @hroncok, @remilapeyre, @arhadthedev
PRs
  • bpo-36048: Use __index__() instead of __int__() for implicit conversion if available. #11952
  • bpo-17576: Strict __int__ and __index__ return types; operator.index always uses __index__ #13740
  • 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-02-25.16:13:58.711>
    created_at = <Date 2019-02-20.06:43:05.294>
    labels = ['interpreter-core', 'type-feature', '3.8']
    title = 'Deprecate implicit truncating when convert Python numbers to C integers: use __index__, not __int__'
    updated_at = <Date 2021-12-09.20:32:01.235>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2021-12-09.20:32:01.235>
    actor = 'calin.culianu'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-02-25.16:13:58.711>
    closer = 'serhiy.storchaka'
    components = ['Interpreter Core']
    creation = <Date 2019-02-20.06:43:05.294>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 36048
    keywords = ['patch']
    message_count = 20.0
    messages = ['336041', '336050', '336069', '336071', '336107', '336127', '336534', '340944', '358943', '360080', '408054', '408077', '408087', '408095', '408098', '408146', '408150', '408153', '408156', '408159']
    nosy_count = 8.0
    nosy_names = ['gvanrossum', 'mark.dickinson', 'vstinner', 'serhiy.storchaka', 'hroncok', 'remi.lapeyre', 'arhadthedev', 'calin.culianu']
    pr_nums = ['11952', '13740']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue36048'
    versions = ['Python 3.8']

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.8 (EOL)end of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancement

      Projects

      No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions