Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
gh-111956: Add thread-safe one-time initialization.#111960
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
The one-time initialization (`_PyOnceFlag`) is used in two places: * `Python/Python-ast.c` * `Python/getargs.c`
colesbury commentedNov 10, 2023
@ericsnowcurrently, when you have some time, would you please look at this? One question: I'm unsure of what |
ericsnowcurrently left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Aside from one small thing, LGTM.
Uh oh!
There was an error while loading.Please reload this page.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
ericsnowcurrently commentedNov 15, 2023
The typical convention in the case of success vs. error is -1 for error and 0 for success. The 0/1 convention is more for true/false situations. |
colesbury commentedNov 15, 2023
@ericsnowcurrently that makes sense. I'll change it to -1=error, 0=success. |
colesbury commentedNov 15, 2023
@ericsnowcurrently, I changed the code to use |
ericsnowcurrently left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM
FWIW, I haven't combed through the asdl_c.py changes but would expect the test suite to catch any mistakes in there. It's also a good sign that you caught the bug ininit_identifiers(). 😄
ericsnowcurrently commentedNov 16, 2023
I'll merge this in the morning if no one beats me to it. |
Uh oh!
There was an error while loading.Please reload this page.
The one-time initialization (
_PyOnceFlag) is used in two places:Python/Python-ast.cPython/getargs.c