Skip to content

Convert _decimal C API from pointer array to struct #87226

Closed

Description

@erlend-aasland
BPO 43060
Nosy @rhettinger, @facundobatista, @mdickinson, @pitrou, @vstinner, @skrah, @shihai1991, @erlend-aasland

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 2021-03-21.17:47:15.112>
created_at = <Date 2021-01-29.09:46:53.700>
labels = ['type-feature', 'library', '3.10']
title = 'Convert _decimal C API from pointer array to struct'
updated_at = <Date 2021-03-21.17:47:15.111>
user = 'https://github.com/erlend-aasland'

bugs.python.org fields:

activity = <Date 2021-03-21.17:47:15.111>
actor = 'erlendaasland'
assignee = 'none'
closed = True
closed_date = <Date 2021-03-21.17:47:15.112>
closer = 'erlendaasland'
components = ['Library (Lib)']
creation = <Date 2021-01-29.09:46:53.700>
creator = 'erlendaasland'
dependencies = []
files = []
hgrepos = []
issue_num = 43060
keywords = []
message_count = 10.0
messages = ['385901', '386635', '386645', '387788', '387938', '387955', '387957', '388075', '388234', '389253']
nosy_count = 8.0
nosy_names = ['rhettinger', 'facundobatista', 'mark.dickinson', 'pitrou', 'vstinner', 'skrah', 'shihai1991', 'erlendaasland']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue43060'
versions = ['Python 3.10']

Activity

  1. erlend-aasland commented on Jan 29, 2021

    @erlend-aasland
    ContributorAuthor

    Ref. discussions on bpo-43009 and bpo-41798.

  2. added
    stdlibStandard Library Python modules in the Lib/ directory
    type-featureA feature request or enhancement
    on Jan 29, 2021
  3. mdickinson commented on Feb 8, 2021

    @mdickinson
    Member

    Can you explain what problem this would be solving?

  4. erlend-aasland commented on Feb 8, 2021

    @erlend-aasland
    ContributorAuthor

    In my opinion, an array of pointers is a bad API; using a struct (like most of the other API's) is an improvement.

    Ref. discussions on #68374 (#24186 (comment)) and bpo-43009.

  5. rhettinger commented on Feb 27, 2021

    @rhettinger
    Contributor

    In my opinion, an array of pointers is a bad API;

    The existing code is how types were made for most of Python's history. It is not "bad"; it is just more wordy. Given that the current code is correct, I don't see any strong reason to churn the code.

  6. shihai1991 commented on Mar 2, 2021

    @shihai1991
    Member

    It is not "bad"; it is just more wordy.

    Agree. Using sturct will be more easy check the members.

    But converting the decimal c api may breaks the compatibility, because some macros like PyDec_TypeCheck_INDEX have been exposed in headers.

  7. erlend-aasland commented on Mar 2, 2021

    @erlend-aasland
    ContributorAuthor

    But converting the decimal c api may breaks the compatibility, because some macros like PyDec_TypeCheck_INDEX have been exposed in headers.

    True. Is there many external users of this API? I could not find any relevant examples using searchcode.com.

  8. pitrou commented on Mar 2, 2021

    @pitrou
    Member

    I have no opinion about *adding* a struct, but we shouldn't remove the existing array of pointers, or this will needlessly break compatibility for existing users of the C API.

  9. shihai1991 commented on Mar 4, 2021

    @shihai1991
    Member

    True. Is there many external users of this API? I could not find any relevant examples using searchcode.com.

    Hm, many teams don't open their code, so we get check all user cases by searchcode web. So I have no any better sugesstion about it :(

  10. mdickinson commented on Mar 7, 2021

    @mdickinson
    Member

    Just a note that bpo-43422 would make this moot.

  11. erlend-aasland commented on Mar 21, 2021

    @erlend-aasland
    ContributorAuthor

    Closing, as the C API was removed in #69148.

  12. 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.10 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions