You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Convert _decimal C API from pointer array to struct #87226
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=Noneclosed_at=<Date2021-03-21.17:47:15.112>created_at=<Date2021-01-29.09:46:53.700>labels= ['type-feature', 'library', '3.10']
title='Convert _decimal C API from pointer array to struct'updated_at=<Date2021-03-21.17:47:15.111>user='https://github.com/erlend-aasland'
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.
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.
Activity
erlend-aasland commentedon Jan 29, 2021
Ref. discussions on bpo-43009 and bpo-41798.
mdickinson commentedon Feb 8, 2021
Can you explain what problem this would be solving?
erlend-aasland commentedon Feb 8, 2021
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 commentedon Feb 27, 2021
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 commentedon Mar 2, 2021
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_INDEXhave been exposed in headers.erlend-aasland commentedon Mar 2, 2021
True. Is there many external users of this API? I could not find any relevant examples using searchcode.com.
pitrou commentedon 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 commentedon Mar 4, 2021
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 commentedon Mar 7, 2021
Just a note that bpo-43422 would make this moot.
erlend-aasland commentedon Mar 21, 2021
Closing, as the C API was removed in #69148.