Skip to content

gh-90928: Improve static initialization of keywords tuple in AC - #95907

Merged
erlend-aasland merged 6 commits into
python:mainfrom
erlend-aasland:improve-gh-95860
Aug 13, 2022
Merged

gh-90928: Improve static initialization of keywords tuple in AC#95907
erlend-aasland merged 6 commits into
python:mainfrom
erlend-aasland:improve-gh-95860

Conversation

@erlend-aasland

@erlend-aaslanderlend-aasland commented Aug 11, 2022

Copy link
Copy Markdown
Contributor

Calculate num_keywords during template generation instead of leaving it to the preprocessor. This makes for much smaller and easier to read (FWIW) AC output.

See discussion in #95860 (comment)

@ericsnowcurrentlyericsnowcurrently left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this! Mostly LGTM.

Also, can you drop "num_keywords" from template_dict now?

Comment threadTools/clinic/clinic.py Outdated
Comment threadTools/clinic/clinic.py Outdated
@bedevere-bot

Copy link
Copy Markdown

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

@erlend-aasland

Copy link
Copy Markdown
ContributorAuthor

Also, can you drop "num_keywords" from template_dict now?

It is already dropped :)

@erlend-aasland

Copy link
Copy Markdown
ContributorAuthor

I have made the requested changes; please review again.

@bedevere-bot

Copy link
Copy Markdown

Thanks for making the requested changes!

@ericsnowcurrently: please review the changes made to this pull request.

@ericsnowcurrentlyericsnowcurrently left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I'll leave it up to you about the two comments I left.

Comment threadTools/clinic/clinic.py Outdated
Comment threadTools/clinic/clinic.py Outdated
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
Comment threadTools/clinic/clinic.py Outdated
@erlend-aasland

Copy link
Copy Markdown
ContributorAuthor

Thanks for reviewing; highly appreciated. I'll make a quick adjustment before landing.

- inline len(keywords)
- use NUM_KEYWORDS constant for improved readability in generated code
@erlend-aasland

Copy link
Copy Markdown
ContributorAuthor

I'm done with the last round of adjustments. I ended up adding both of your last suggestions. Thanks again.

@erlend-aasland

Copy link
Copy Markdown
ContributorAuthor

FYI, I'll wait with merging until Kumar has finished his review.

@kumaraditya303kumaraditya303 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@erlend-aasland

Copy link
Copy Markdown
ContributorAuthor

Thanks for the reviews!

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@erlend-aasland@bedevere-bot@ericsnowcurrently@kumaraditya303