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

Convert _decimal C API from pointer array to struct #87226

Closed
erlend-aasland opened this issue Jan 29, 2021 · 10 comments
Closed

Convert _decimal C API from pointer array to struct #87226

erlend-aasland opened this issue Jan 29, 2021 · 10 comments
Labels
3.10 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@erlend-aasland
Copy link
Contributor

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']

@erlend-aasland
Copy link
Contributor Author

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

@erlend-aasland erlend-aasland added 3.10 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Jan 29, 2021
@mdickinson
Copy link
Member

Can you explain what problem this would be solving?

@erlend-aasland
Copy link
Contributor Author

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.

@rhettinger
Copy link
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.

@shihai1991
Copy link
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.

@erlend-aasland
Copy link
Contributor Author

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.

@pitrou
Copy link
Member

pitrou commented Mar 2, 2021

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.

@shihai1991
Copy link
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 :(

@mdickinson
Copy link
Member

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

@erlend-aasland
Copy link
Contributor Author

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

@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 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

5 participants