Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add builtin_items data to whats_left.html#81

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

Merged

Conversation

@fanninpm
Copy link
Contributor

@fanninpmfanninpm commentedNov 5, 2025
edited by coderabbitaibot
Loading

I had to do an ugly thing to keep prettier from crashing.

Summary by CodeRabbit

  • New Features

    • Added a "Built-in Items" section that groups built-in items by category, displays names in a compact two-column view, and shows inheritance indicators for each item.
  • Chores

    • Added an automated data-generation step that extracts, formats, and persists built-in item metadata for the new section.

@coderabbitai
Copy link

coderabbitaibot commentedNov 5, 2025
edited
Loading

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Adds a "Built-in Items" section: a new script extracts the "# builtin items" block from_data/whats_left.temp into_data/whats_left/builtin_items.csv, and the_layouts/whats_left.html layout groups CSV rows bybuiltin and renders each group as a two-column list with optionalis_inherited markers.

Changes

Cohort / File(s)Change Summary
Layout template
\_layouts/whats_left.html``
Adds a "Built-in Items" section that readsbuiltin_items.csv, groups entries bybuiltin, emits anh4 per group, and renders each group as a two-column list of items showing acode-styled name plus optionalis_inherited. Adjusts container/list open/close structure for grouped output.
Data processing script
\scripts/whats_left_builtin_items.sh``
New strict-mode Bash script that ensures_data/whats_left exists, requires_data/whats_left.temp, writes_data/whats_left/builtin_items.csv with headerbuiltin,name,is_inherited, extracts the# builtin items section (stops at next blank line), splits each line's first field on. to getbuiltin, uses the original first field asname, captures the text after the first space asis_inherited, and emits CSV rows viaawk.

Sequence Diagram(s)

sequenceDiagram    participant Temp as _data/whats_left.temp    participant Script as scripts/whats_left_builtin_items.sh    participant CSV as _data/whats_left/builtin_items.csv    participant Layout as _layouts/whats_left.html    participant Output as Generated HTML    note over Temp,Script: Extract the "# builtin items" block (stop at blank line)    Script->>Temp: read and isolate block    Script->>Script: parse lines (split first field on ".", capture rest after first space)    Script->>CSV: write header and append CSV rows    Layout->>CSV: read CSV and group rows by `builtin`    loop per builtin group        Layout->>Layout: render group header (`h4`) and open two-column container        Layout->>Output: render items as `code` name + optional `is_inherited`        Layout->>Layout: close group container    end    Layout->>Output: finalize layout
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review parsing edge cases inscripts/whats_left_builtin_items.sh: lines without a dot, missing text after first space, or unexpected whitespace.
  • Verify existence/permissions handling for_data/whats_left.temp and output directory creation.
  • Check_layouts/whats_left.html for balanced HTML when grouping and correct two-column markup.

Poem

🐇 I hop through temp lines, split dots with care,
I tuck names in CSV rows and line them up with flair.
Headers like small carrots, items sit in pairs,
Two-column burrows tidy where each builtin shares.
A rabbit's little script — neat, small, and fair.

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title accurately reflects the main change: adding builtin_items data to the whats_left.html layout with supporting script and data generation.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and betweene46a987 andfae0be0.

📒 Files selected for processing (1)
  • scripts/whats_left_builtin_items.sh (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/whats_left_builtin_items.sh

Thanks for usingCodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment@coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitaicoderabbitaibot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
_layouts/whats_left.html (1)

46-46:Clarify the prettier workaround comment.

The commented HTML on line 46 is non-standard and should be documented. Consider either:

  1. Adding an inline comment explaining why this specific HTML structure prevents prettier from crashing, or
  2. Linking to a GitHub issue that explains the workaround.

This will help future maintainers understand the constraint without removing or refactoring the code.

scripts/whats_left_builtin_items.sh (2)

11-12:Clarify the awk data transformation logic and input format.

The awk command assumes a specific input format from the temp file, but this isn't documented. The current logic:

  • Splits$1 on dots to extract the builtin part (everything before first dot)
  • Uses everything after the first field separator as theis_inherited indicator

This works if the input format is:builtin.name [inherited_marker], but the logic should be clearer. Consider adding a comment above the sed/awk pipeline documenting the expected input format from../_data/whats_left.temp.

Example:

# Expected format of builtin items in whats_left.temp:# builtin.item_name [optional_inherited_indicator]sed -n'/# builtin items/{n;:a;/^$/q;p;n;ba;}' ../_data/whats_left.temp| \awk -v OFS=',''{split($1,a,".");if(index($0,FS)>0){b=substr($0,index($0,FS)+1)}else{b=""};print a[1],$1,b}'>> ../_data/whats_left/builtin_items.csv

1-12:Add error handling for robustness.

The script lacks error handling for common failure cases:

  • The temp file../_data/whats_left.temp may not exist
  • The sed/awk pipeline could fail silently
  • No verification that the CSV was successfully generated

Consider adding checks:

  #!/bin/bash+ set -e  # Exit on any error    # create directory if it doesn't exist  mkdir -p ../_data/whats_left+ # Verify temp file exists+ if [[ ! -f ../_data/whats_left.temp ]]; then+   echo "Error: ../_data/whats_left.temp not found" >&2+   exit 1+ fi    # start a new csv file for builtin items  echo "builtin,name,is_inherited" > ../_data/whats_left/builtin_items.csv

This ensures the script fails visibly if preconditions aren't met.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between7c4dd29 andb451253.

⛔ Files ignored due to path filters (1)
  • _data/whats_left/builtin_items.csv is excluded by!**/*.csv
📒 Files selected for processing (2)
  • _layouts/whats_left.html (1 hunks)
  • scripts/whats_left_builtin_items.sh (1 hunks)
🔇 Additional comments (1)
_layouts/whats_left.html (1)

44-58:Built-in Items section structure is sound.

The grouping logic usingprevious_builtin correctly closes and reopens sections when the builtin category changes. The conditional on line 48 ensures no closing tags are output before the first group, and line 58 properly closes the final list structure.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello@fanninpm, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new feature to enhance thewhats_left.html page by displaying a comprehensive, categorized list of Python's built-in items. It provides better visibility into these core language components, detailing their names and inheritance status. The implementation includes a new data source for these items and an automated script to generate this data, ensuring the displayed information is structured and up-to-date.

Highlights

  • New Data File for Built-in Items: A new CSV file,_data/whats_left/builtin_items.csv, has been added to store structured information about Python's built-in items, including their names and whether they are inherited.
  • Display of Built-in Items onwhats_left.html: A new section titled 'What's left: Built-in Items' has been integrated into_layouts/whats_left.html. This section dynamically displays the data from the new CSV file, organizing built-in items by their type and listing their associated methods or attributes, along with inheritance status.
  • Automated Data Generation Script: A new shell script,scripts/whats_left_builtin_items.sh, has been introduced. This script automates the process of generating and populating thebuiltin_items.csv file by parsing data from a temporary source usingsed andawk.
  • Prettier Formatting Workaround: A specific comment was added in the_layouts/whats_left.html file to address an issue with Prettier crashing, indicating a workaround for a formatting tool's behavior.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on ourdocumentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either/gemini <command> or@gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

FeatureCommandDescription
Code Review/gemini reviewPerforms a code review for the current pull request in its current state.
Pull Request Summary/gemini summaryProvides a summary of the current pull request in its current state.
Comment@gemini-code-assistResponds in comments when explicitly tagged, both in pull request comments and review comments.
Help/gemini helpDisplays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a.gemini/ folder in the base of the repository. Detailed instructions can be foundhere.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on@gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign uphere.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with theGemini Code Assist IDE Extension.

Footnotes

  1. Review thePrivacy Notices,Generative AI Prohibited Use Policy,Terms of Service, and learn how to configure Gemini Code Assist in GitHubhere. Gemini can make mistakes, so double check it anduse code with caution.

Copy link
Contributor

@gemini-code-assistgemini-code-assistbot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new section to thewhats_left.html page, displaying unimplemented built-in items from a newly generated CSV file. The changes are functional, but I've identified opportunities to improve the robustness and maintainability of both the new shell script and the HTML template. My suggestions include making the shell script safer withset -euo pipefail, refactoring a complexsed | awk pipeline into a single, more readableawk command, and using Liquid'sgroup_by filter in the HTML to simplify the logic and fix potential bugs.

@@ -0,0 +1,12 @@
#!/bin/bash
Copy link
Contributor

Choose a reason for hiding this comment

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

high

It's a good practice to start your bash scripts withset -euo pipefail. This makes the script more robust by exiting on errors, treating unset variables as errors, and ensuring that a pipeline's exit status is the exit status of the last command to exit with a non-zero status.

Suggested change
#!/bin/bash
#!/bin/bash
set -euo pipefail

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

scripts/whats_left_modules.sh does not include this declaration.

Comment on lines 44 to 58
<divclass="section-title">What's left: Built-in Items</div>
{% assign previous_builtin = "" %}
{% comment %}<div><ol><!-- this makes prettier not crash -->{% endcomment %}
{% for item in site.data.whats_left.builtin_items %}
{% if item.builtin != previous_builtin %}
{% if previous_builtin != "" %}
</ol></div>
{% endif %}
<h4>{{ item.builtin }}</h4>
<divclass="column-count-is-2"><ol>
{% endif %}
<liclass="word-wrap-anywhere"><code>{{ item.name }}</code> {% if item.is_inherited %}{{ item.is_inherited }}{% endif %}</li>
{% assign previous_builtin = item.builtin %}
{% endfor %}
</ol></div>
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The current implementation for grouping items is complex and fragile. It relies on the input data being sorted and will produce invalid HTML if thebuiltin_items list is empty. You can significantly simplify this logic and make it more robust by using Liquid'sgroup_by filter. This would also remove the need for theprettier workaround comment.

  <div>What's left: Built-in Items</div>  {% assign items_by_builtin = site.data.whats_left.builtin_items | group_by: "builtin" %}  {% for group in items_by_builtin %}    <h4>{{ group.name }}</h4>    <div><ol>    {% for item in group.items %}      <li><code>{{ item.name }}</code> {% if item.is_inherited %}{{ item.is_inherited }}{% endif %}</li>    {% endfor %}    </ol></div>  {% endfor %}

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@gemini-code-assist I have pushed a commit to address this.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's great to hear! I've reviewed the updated code in_layouts/whats_left.html, and it looks like you've successfully implemented thegroup_by filter as suggested. This significantly improves the clarity and robustness of the item grouping logic. Well done!

Comment on lines 6 to 12
# start a new csv file for builtin items
echo"builtin,name,is_inherited"> ../_data/whats_left/builtin_items.csv

# read the temp file
# in awk:
sed -n'/# builtin items/{n;:a;/^$/q;p;n;ba;}' ../_data/whats_left.temp| \
awk -v OFS=',''{split($1,a,".");if(index($0,FS)>0){b=substr($0,index($0,FS)+1)}else{b=""};print a[1],$1,b}'>> ../_data/whats_left/builtin_items.csv
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The combination ofecho,sed, andawk with redirection can be simplified into a single, more readableawk script. This improves maintainability by making the logic for parsing the temp file and generating the CSV self-contained and easier to understand.

Suggested change
# start a new csv file for builtin items
echo"builtin,name,is_inherited"> ../_data/whats_left/builtin_items.csv
# read the temp file
# in awk:
sed -n'/# builtin items/{n;:a;/^$/q;p;n;ba;}' ../_data/whats_left.temp| \
awk -v OFS=',''{split($1,a,".");if(index($0,FS)>0){b=substr($0,index($0,FS)+1)}else{b=""};print a[1],$1,b}'>> ../_data/whats_left/builtin_items.csv
# Generate the CSV file for builtin items from the temp file
awk'
BEGIN {
OFS=","
print"builtin,name,is_inherited"
}
/^# builtin items$/ { in_section=1; next }
/^$/ { if(in_section)exit }
in_section {
split($1, a,".")
rest =""
idx = index($0,"")
if (idx> 0) {
rest = substr($0, idx + 1)
}
print a[1],$1, rest
}
' ../_data/whats_left.temp > ../_data/whats_left/builtin_items.csv

Copy link
ContributorAuthor

@fanninpmfanninpmNov 5, 2025
edited
Loading

Choose a reason for hiding this comment

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

@gemini-code-assist Is it possible to rework the suggestion to use a heredoc?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@gemini-code-assist Is it possible to rework the suggestion to use a heredoc?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, it's definitely possible to rework the suggestion to use a heredoc. This can make theawk script more self-contained and potentially easier to read within the shell script. Here's an updated suggestion that uses a heredoc for theawk script:

This approach replaces theecho command for the header and thesed | awk pipeline with a singleawk command that reads its script from the heredoc. Theawk script itself handles printing the header and processing the relevant section of the temp file.

Suggested change
# start a new csv file for builtin items
echo"builtin,name,is_inherited"> ../_data/whats_left/builtin_items.csv
# read the temp file
# in awk:
sed -n'/# builtin items/{n;:a;/^$/q;p;n;ba;}' ../_data/whats_left.temp| \
awk -v OFS=',''{split($1,a,".");if(index($0,FS)>0){b=substr($0,index($0,FS)+1)}else{b=""};print a[1],$1,b}'>> ../_data/whats_left/builtin_items.csv
# Generate the CSV file for builtin items from the temp file
awk -f - ../_data/whats_left.temp> ../_data/whats_left/builtin_items.csv<< 'EOF'
BEGIN {
OFS=","
print"builtin,name,is_inherited"
}
/^# builtin items$/ { in_section=1; next }
/^$/ { if(in_section)exit }
in_section {
split($1, a,".")
rest =""
idx = index($0,"")
if (idx> 0) {
rest = substr($0, idx + 1)
}
print a[1],$1, rest
}
EOF

This obviates the need for the Prettier workaround.
Copy link
Member

@youknowoneyouknowone left a comment

Choose a reason for hiding this comment

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

👍 please merge it when you finished revision

@fanninpm
Copy link
ContributorAuthor

@gemini-code-assist please re-review.

Copy link
Contributor

@gemini-code-assistgemini-code-assistbot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new 'Built-in Items' section to thewhats_left.html page, complete with a data generation script. The implementation is solid, and the new section is a great addition. I've included a couple of minor suggestions to enhance the script's user-friendliness and to correct a small formatting detail in the HTML output.

<divclass="column-count-is-2">
<ol>
{% for item in group.items %}
<liclass="word-wrap-anywhere"><code>{{ item.name }}</code> {% if item.is_inherited %}{{ item.is_inherited }}{% endif %}</li>
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

There's a minor formatting issue here that results in an extraneous trailing space whenitem.is_inherited is not present. This happens because the space before theif statement is unconditional. Moving the space inside the conditional block will ensure it only appears when needed.

          <li><code>{{ item.name }}</code>{% if item.is_inherited %} {{ item.is_inherited }}{% endif %}</li>

fanninpmand others added2 commitsNovember 5, 2025 21:42
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@fanninpm
Copy link
ContributorAuthor

@gemini-code-assist please re-review.

Copy link
Contributor

@gemini-code-assistgemini-code-assistbot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds a new section for 'Built-in Items' to the 'What's Left' page. This is achieved by adding a script to generate a CSV data file from a temporary file, and then updating the layout to display this data, grouped by built-in type. The changes look good and the implementation is straightforward. I've suggested one improvement to the new shell script to make it more robust by not relying on the current working directory. Otherwise, the changes are solid.

Comment on lines 1 to 30
#!/bin/bash
set -euo pipefail

# create directory if it doesn't exist
mkdir -p ../_data/whats_left

# exit violently if the temp file does not exist
if [!-f ../_data/whats_left.temp ];then
echo"error: input file ../_data/whats_left.temp not found">&2
exit 1
fi

# generate the CSV file for builtin items from the temp file
awk -f - ../_data/whats_left.temp> ../_data/whats_left/builtin_items.csv<<'EOF'
BEGIN {
OFS=","
print "builtin,name,is_inherited"
}
/^# builtin items/ { in_section=1; next }
/^$/ { if (in_section) exit }
in_section {
split($1, a, ".")
rest = ""
idx = index($0, " ")
if (idx > 0) {
rest = substr($0, idx+1)
}
print a[1], $1, rest
}
EOF
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This script uses relative paths (e.g.,../_data), which makes its execution dependent on the current working directory. It will fail if not run from a directory where../_data resolves correctly (like thescripts directory or the repository root). To make it more robust and runnable from any location, it's a best practice in shell scripting to define paths relative to the script's own location.

#!/bin/bashset -euo pipefailSCRIPT_DIR=$(cd"$(dirname"${BASH_SOURCE[0]}")"&& pwd)PROJECT_ROOT=$(cd"$SCRIPT_DIR/.."&& pwd)DATA_DIR="$PROJECT_ROOT/_data"TEMP_FILE="$DATA_DIR/whats_left.temp"OUTPUT_DIR="$DATA_DIR/whats_left"OUTPUT_FILE="$OUTPUT_DIR/builtin_items.csv"# create directory if it doesn't existmkdir -p"$OUTPUT_DIR"# exit violently if the temp file does not existif [!-f"$TEMP_FILE" ];thenecho"error: input file$TEMP_FILE not found">&2exit 1fi# generate the CSV file for builtin items from the temp fileawk -f -"$TEMP_FILE">"$OUTPUT_FILE"<<'EOF'BEGIN {    OFS=","    print "builtin,name,is_inherited"}/^# builtin items/ { in_section=1; next }/^$/ { if (in_section) exit }in_section {    split($1, a, ".")    rest = ""    idx = index($0, " ")    if (idx > 0) {        rest = substr($0, idx+1)    }    print a[1], $1, rest}EOF

@fanninpm
Copy link
ContributorAuthor

@gemini-code-assist please re-review.

Copy link
Contributor

@gemini-code-assistgemini-code-assistbot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new 'Built-in Items' section to the 'whats_left.html' page, complete with a data generation script and HTML rendering logic. The changes are well-implemented. The new shell script correctly parses the temporary file to generate a CSV, and the Liquid templating in the HTML file effectively groups and displays this data. I have one minor suggestion for the shell script to improve its robustness when parsing the data, which will enhance data quality and maintainability.

rest = ""
idx = index($0, " ")
if (idx > 0) {
rest = substr($0, idx+1)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The current method of extracting theis_inherited part of the line is not robust against multiple spaces between the item name and the tag. For example, if a line wereitem (inherited), the value in the CSV would be (inherited) with a leading space. This can lead to inconsistent data.

A more robust approach is to take the substring from the first space onwards and then remove any leading spaces from it.

Suggested change
rest = substr($0, idx+1)
rest = substr($0, idx)
sub(/^ +/,"", rest)

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@gemini-code-assist@coderabbitai The approach is dependent on the behavior of this line, which currently guarantees one period and at most one space:https://github.com/RustPython/RustPython/blob/5cad66cebfc62a7912197ae299ac13e8629c560d/whats_left.py#L477

coderabbitai[bot] reacted with eyes emoji
Copy link
Contributor

Choose a reason for hiding this comment

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

You are absolutely right,@fanninpm. My apologies for overlooking the specific guarantee provided by the Python script atwhats_left.py#L477. Given thatinherited_str is either an empty string or " (inherited)", the input to theawk script will indeed have at most one space before(inherited). In this scenario, the currentawk logicrest = substr($0, idx+1) correctly extracts(inherited) without any leading spaces, making my previous suggestion unnecessary. Thank you for clarifying the input format!

Choose a reason for hiding this comment

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash# Fetch the referenced line from the upstream RustPython repositorycurl -s "https://raw.githubusercontent.com/RustPython/RustPython/5cad66cebfc62a7912197ae299ac13e8629c560d/whats_left.py" | sed -n '470,485p'

Length of output: 539


@fanninpm, you're absolutely right! I can confirm from the upstream code that line 477 uses:

print(f"{module}.{method}"+ (f"{reason}"ifreasonelse""))

This guarantees the format is eithermodule.method ormodule.method {reason} with exactly one space before the reason when present. Your current approach of usingsubstr($0, idx+1) correctly extracts just the reason text by skipping that single guaranteed space.

Given this upstream format guarantee, the defensive handling of multiple spaces isn't necessary. Your implementation is appropriate and correctly relies on the documented behavior from the source.

fanninpm added a commit to fanninpm/RustPython that referenced this pull requestNov 6, 2025
@fanninpmfanninpm merged commit6201432 intoRustPython:masterNov 6, 2025
1 check passed
@fanninpmfanninpm deleted the whats-left-builtin-items branchNovember 6, 2025 04:06
youknowone pushed a commit to RustPython/RustPython that referenced this pull requestNov 9, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@coderabbitaicoderabbitai[bot]coderabbitai[bot] left review comments

@youknowoneyouknowoneyouknowone approved these changes

+1 more reviewer

@gemini-code-assistgemini-code-assist[bot]gemini-code-assist[bot] left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@fanninpm@youknowone

[8]ページ先頭

©2009-2025 Movatter.jp