Skip to content

Align _opcode_metadata.py to 3.14.3#7456

Open
ShaharNaveh wants to merge 8 commits intoRustPython:mainfrom
ShaharNaveh:align-opcode-metadata
Open

Align _opcode_metadata.py to 3.14.3#7456
ShaharNaveh wants to merge 8 commits intoRustPython:mainfrom
ShaharNaveh:align-opcode-metadata

Conversation

@ShaharNaveh
Copy link
Contributor

@ShaharNaveh ShaharNaveh commented Mar 17, 2026

Summary by CodeRabbit

  • New Features

    • Broader opcode specialization support for improved handling of specialized instruction variants.
  • Bug Fixes

    • Runtime validation now surfaces invalid opcode/oparg errors earlier for safer execution.
  • Chores

    • CI now sets an explicit Python version for reproducible workflows.
    • Reorganized deoptimization handling to cover more specialized opcodes.
    • Enhanced opcode metadata generation with priority-aware ordering and richer classification.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 62f65387-15f3-4479-b5e8-3db91b3ab342

📥 Commits

Reviewing files that changed from the base of the PR and between 4c9193c and 2aef7fc.

📒 Files selected for processing (1)
  • crates/compiler-core/src/bytecode/instruction.rs

📝 Walkthrough

Walkthrough

Adds a Python setup step to CI; converts multiple Instruction helpers to const, centralizes deoptimization via a new deopt() path; extends the opcode metadata generator to detect specialized opcodes, include have_oparg, priority ordering, and emit specialized opmaps; adds a runtime validation for specialized opcodes in stack_effect.

Changes

Cohort / File(s) Summary
GitHub Workflow
/.github/workflows/pr-format.yaml
Adds top-level PYTHON_VERSION and a step using actions/[email protected] to install Python before running generate_opcode_metadata.py.
Bytecode instruction logic
crates/compiler-core/src/bytecode/instruction.rs
Makes is_instrumented, to_base, cache_entries const fns; adds pub const fn deopt(self) -> Option<Self>; rewrites deoptimize() to use deopt()/to_base() and consolidates many specialized opcodes into grouped base mappings.
Opcode metadata generator
scripts/generate_opcode_metadata.py
Adds PRIORITY_OPMAP, to_pascal_case, build_deopts; extends Opcode with have_oparg and is_instrumented; parses Rust deopt arms to detect specializations; changes sorting to honor priority opcodes; emits _specializations, _specialized_opmap, opmap, HAVE_ARGUMENT, and MIN_INSTRUMENTED_OPCODE.
Stdlib opcode runtime check
crates/stdlib/src/_opcode.rs
Adds validation in stack_effect to raise ValueError("invalid opcode or oparg") when a specialized opcode’s inner real instruction has a deopt set, short-circuiting further processing.
Manifests / Build
Cargo.toml, other manifest edits
Updated Cargo.toml lines and related manifest adjustments accompanying the crate changes (mixed additions/removals across manifests).

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

Suggested reviewers

  • youknowone

Poem

🐇 I hopped through opcodes, sorted neat and bright,
Turned many variants back into base at night,
Python installed, metadata pruned and primed,
Deopts folded, opmaps ordered, all aligned,
A rabbit's small cheer for bytecode done right.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objective of the pull request—aligning the opcode metadata to Python 3.14.3—which is reflected in the significant changes to scripts/generate_opcode_metadata.py and related compiler-core files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! 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
Contributor Author

@ShaharNaveh ShaharNaveh Mar 17, 2026

Choose a reason for hiding this comment

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

Changes to this file are purely "cosmetic". Altering the arms order (and variants order) so the generated output will match CPython

@github-actions
Copy link
Contributor

github-actions bot commented Mar 17, 2026

📦 Library Dependencies

The following Lib/ modules were modified. Here are their dependencies:

[x] lib: cpython/Lib/opcode.py
[ ] lib: cpython/Lib/_opcode_metadata.py
[x] test: cpython/Lib/test/test__opcode.py
[x] test: cpython/Lib/test/test_opcodes.py

dependencies:

  • opcode (native: _opcode, builtins)
    • _opcode_metadata
    • _opcode_metadata

dependent tests: (44 tests)

  • opcode: test__opcode test_code test_compile test_dis test_peepholer
    • dis: test_ast test_compiler_assemble test_dtrace test_fstring test_inspect test_monitoring test_opcache test_patma test_positional_only_arg
      • bdb: test_bdb
      • inspect: test_abc test_argparse test_asyncgen test_buffer test_builtin test_collections test_coroutines test_decimal test_enum test_functools test_generators test_grammar test_ntpath test_operator test_posixpath test_pydoc test_signal test_sqlite3 test_traceback test_type_annotations test_types test_typing test_unittest test_yield_from test_zipimport test_zoneinfo
      • modulefinder: test_importlib test_modulefinder
      • trace: test_trace

[x] lib: cpython/Lib/dis.py
[ ] test: cpython/Lib/test/test_dis.py (TODO: 36)

dependencies:

  • dis

dependent tests: (70 tests)

  • dis: test__opcode test_ast test_code test_compile test_compiler_assemble test_dis test_dtrace test_fstring test_inspect test_monitoring test_opcache test_patma test_peepholer test_positional_only_arg
    • bdb: test_bdb
    • inspect: test_abc test_argparse test_asyncgen test_buffer test_builtin test_collections test_coroutines test_decimal test_enum test_functools test_generators test_grammar test_ntpath test_operator test_posixpath test_pydoc test_signal test_sqlite3 test_traceback test_type_annotations test_types test_typing test_unittest test_yield_from test_zipimport test_zoneinfo
      • ast: test_compiler_codegen test_future_stmt test_site test_ssl test_type_comments test_ucn test_unparse
      • asyncio: test_asyncio test_contextlib_async test_logging test_os test_sys_settrace test_unittest
      • cmd: test_cmd
      • dataclasses: test__colorize test_copy test_ctypes test_genericalias test_pprint test_regrtest
      • importlib.metadata: test_importlib
      • pkgutil: test_pkgutil test_runpy
      • rlcompleter: test_rlcompleter
      • trace: test_trace
      • xmlrpc.server: test_docxmlrpc test_xmlrpc
    • modulefinder: test_importlib test_modulefinder

Legend:

  • [+] path exists in CPython
  • [x] up-to-date, [ ] outdated

@ShaharNaveh ShaharNaveh marked this pull request as ready for review March 17, 2026 12:22
@ShaharNaveh ShaharNaveh requested a review from youknowone March 17, 2026 12:22
Copy link
Contributor

@coderabbitai coderabbitai bot 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: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/pr-format.yaml (1)

55-61: ⚠️ Potential issue | 🟡 Minor

Mention opcode metadata regeneration in the failure hint.

Line 61 still tells contributors to rerun only cargo fmt/ruff, but this job now also rewrites Lib/_opcode_metadata.py. If generate_opcode_metadata.py is the only source of diff, the current message sends people to the wrong fix.

Suggested tweak
-            echo "::error::Formatting changes detected. Please run 'cargo fmt --all', 'ruff format', and 'ruff check --select I --fix' locally."
+            echo "::error::Formatting or generated-file changes detected. Please run 'cargo fmt --all', 'ruff format', 'ruff check --select I --fix', and 'python scripts/generate_opcode_metadata.py' locally."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pr-format.yaml around lines 55 - 61, Update the failure
hint in the "Check for formatting changes" job so it mentions regenerating
opcode metadata; specifically, when the git diff check fails after running
scripts/generate_opcode_metadata.py, include guidance to run python
scripts/generate_opcode_metadata.py (and commit Lib/_opcode_metadata.py) in
addition to 'cargo fmt --all', 'ruff format', and 'ruff check --select I --fix'
so contributors know to regenerate Lib/_opcode_metadata.py if that is the only
change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/generate_opcode_metadata.py`:
- Around line 75-78: The current build_deopts function assumes re.search found a
match and calls .group(1) which raises an opaque AttributeError if the
deoptimize() signature isn't present; update build_deopts to check the result of
re.search(r"fn deoptimize\(self\) -> Self(.*)", contents, re.DOTALL) (the match
object used to produce raw_body) and if it's None raise a ValueError with a
clear message like "deoptimize() signature not found in input contents" so CI
failures are immediately actionable.
- Around line 133-136: The generated file banner stored in the output variable
in generate_opcode_metadata.py still says "CPython 3.13 compatible opcode
numbers"; update that string to reference "CPython 3.14 compatible opcode
numbers" (and adjust any surrounding version numbers in the same output
variable) so regenerated artifacts advertise the correct 3.14 version; locate
the output variable definition near the top of the script and change the
embedded version text accordingly.

---

Outside diff comments:
In @.github/workflows/pr-format.yaml:
- Around line 55-61: Update the failure hint in the "Check for formatting
changes" job so it mentions regenerating opcode metadata; specifically, when the
git diff check fails after running scripts/generate_opcode_metadata.py, include
guidance to run python scripts/generate_opcode_metadata.py (and commit
Lib/_opcode_metadata.py) in addition to 'cargo fmt --all', 'ruff format', and
'ruff check --select I --fix' so contributors know to regenerate
Lib/_opcode_metadata.py if that is the only change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: d00895b0-bbe5-4a1f-95f1-f0e288b1617c

📥 Commits

Reviewing files that changed from the base of the PR and between f868f81 and e59d6cd.

⛔ Files ignored due to path filters (2)
  • Lib/_opcode_metadata.py is excluded by !Lib/**
  • Lib/test/test_dis.py is excluded by !Lib/**
📒 Files selected for processing (3)
  • .github/workflows/pr-format.yaml
  • crates/compiler-core/src/bytecode/instruction.rs
  • scripts/generate_opcode_metadata.py

Comment on lines +75 to +78
def build_deopts(contents: str) -> dict[str, list[str]]:
raw_body = re.search(
r"fn deoptimize\(self\) -> Self(.*)", contents, re.DOTALL
).group(1)
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fail with a clear error when deoptimize() is not found.

If the Rust signature or surrounding text changes, this becomes an opaque AttributeError from .group(1). Raising a ValueError here makes CI failures much easier to diagnose.

Suggested tweak
 def build_deopts(contents: str) -> dict[str, list[str]]:
-    raw_body = re.search(
-        r"fn deoptimize\(self\) -> Self(.*)", contents, re.DOTALL
-    ).group(1)
+    deopt_match = re.search(
+        r"fn deoptimize\(self\) -> Self(.*)", contents, re.DOTALL
+    )
+    if not deopt_match:
+        raise ValueError("Could not find Instruction.deoptimize()")
+    raw_body = deopt_match.group(1)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
def build_deopts(contents: str) -> dict[str, list[str]]:
raw_body = re.search(
r"fn deoptimize\(self\) -> Self(.*)", contents, re.DOTALL
).group(1)
def build_deopts(contents: str) -> dict[str, list[str]]:
deopt_match = re.search(
r"fn deoptimize\(self\) -> Self(.*)", contents, re.DOTALL
)
if not deopt_match:
raise ValueError("Could not find Instruction.deoptimize()")
raw_body = deopt_match.group(1)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/generate_opcode_metadata.py` around lines 75 - 78, The current
build_deopts function assumes re.search found a match and calls .group(1) which
raises an opaque AttributeError if the deoptimize() signature isn't present;
update build_deopts to check the result of re.search(r"fn deoptimize\(self\) ->
Self(.*)", contents, re.DOTALL) (the match object used to produce raw_body) and
if it's None raise a ValueError with a clear message like "deoptimize()
signature not found in input contents" so CI failures are immediately
actionable.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
scripts/generate_opcode_metadata.py (1)

1-5: ⚠️ Potential issue | 🟡 Minor

Update module docstring to reference CPython 3.14.

The docstring on line 4 still mentions "CPython 3.13" while the generated banner at line 134 correctly references 3.14.

Proposed fix
 """
 Generate Lib/_opcode_metadata.py for RustPython bytecode.

-This file generates opcode metadata that is compatible with CPython 3.13.
+This file generates opcode metadata that is compatible with CPython 3.14.
 """
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/generate_opcode_metadata.py` around lines 1 - 5, The module docstring
at the top of scripts/generate_opcode_metadata.py still says "CPython 3.13";
update that string to "CPython 3.14" so the header matches the generated banner
(the triple-quoted module docstring near the top of the file and the banner
referenced around line 134). Keep the rest of the docstring text unchanged—only
change the version token from "3.13" to "3.14".
♻️ Duplicate comments (1)
scripts/generate_opcode_metadata.py (1)

75-78: ⚠️ Potential issue | 🟡 Minor

Add error handling when deoptimize() signature is not found.

The re.search(...).group(1) call will raise an opaque AttributeError if the Rust signature changes or isn't found. This makes CI failures difficult to diagnose.

Proposed fix
 def build_deopts(contents: str) -> dict[str, list[str]]:
-    raw_body = re.search(
+    deopt_match = re.search(
         r"fn deoptimize\(self\) -> Self(.*)", contents, re.DOTALL
-    ).group(1)
+    )
+    if not deopt_match:
+        raise ValueError("Could not find Instruction.deoptimize() in source")
+    raw_body = deopt_match.group(1)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/generate_opcode_metadata.py` around lines 75 - 78, The code in
build_deopts uses re.search(...).group(1) which will raise an AttributeError if
the deoptimize() signature isn't found; change it to first assign the result of
re.search to a variable (e.g., match = re.search(r"fn deoptimize\(self\) ->
Self(.*)", contents, re.DOTALL)), check if match is None, and if so raise a
clear RuntimeError or ValueError with a descriptive message that includes enough
context (e.g., mention build_deopts, deoptimize() not found and a short snippet
or length of contents) so CI failures are actionable; otherwise use
match.group(1) to set raw_body and continue.
🧹 Nitpick comments (1)
scripts/generate_opcode_metadata.py (1)

81-86: Rename ambiguous lambda parameter l to line.

Flake8 E741 flags l as ambiguous (easily confused with 1 or I). Rename for clarity.

Proposed fix
     body = "\n".join(
         itertools.takewhile(
-            lambda l: not l.startswith("_ =>"),  # Take until reaching fallback
+            lambda line: not line.startswith("_ =>"),  # Take until reaching fallback
             filter(
-                lambda l: (
-                    not l.startswith(("//", "match"))  # Skip comments or start of match
+                lambda line: (
+                    not line.startswith(("//", "match"))  # Skip comments or start of match
                 ),
                 map(str.strip, raw_body.splitlines()),
             ),
         )
     ).removeprefix("{")
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/generate_opcode_metadata.py` around lines 81 - 86, Rename the
ambiguous lambda parameter `l` to `line` in the two lambdas used when processing
raw_body (the lambda used in the take-until condition not l.startswith("_ =>")
and the lambda inside filter that checks not l.startswith(("//", "match"))),
i.e., update both anonymous functions to use `line` and adjust their bodies to
call line.startswith(...) so Flake8 E741 is resolved while keeping behavior
identical.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@scripts/generate_opcode_metadata.py`:
- Around line 1-5: The module docstring at the top of
scripts/generate_opcode_metadata.py still says "CPython 3.13"; update that
string to "CPython 3.14" so the header matches the generated banner (the
triple-quoted module docstring near the top of the file and the banner
referenced around line 134). Keep the rest of the docstring text unchanged—only
change the version token from "3.13" to "3.14".

---

Duplicate comments:
In `@scripts/generate_opcode_metadata.py`:
- Around line 75-78: The code in build_deopts uses re.search(...).group(1) which
will raise an AttributeError if the deoptimize() signature isn't found; change
it to first assign the result of re.search to a variable (e.g., match =
re.search(r"fn deoptimize\(self\) -> Self(.*)", contents, re.DOTALL)), check if
match is None, and if so raise a clear RuntimeError or ValueError with a
descriptive message that includes enough context (e.g., mention build_deopts,
deoptimize() not found and a short snippet or length of contents) so CI failures
are actionable; otherwise use match.group(1) to set raw_body and continue.

---

Nitpick comments:
In `@scripts/generate_opcode_metadata.py`:
- Around line 81-86: Rename the ambiguous lambda parameter `l` to `line` in the
two lambdas used when processing raw_body (the lambda used in the take-until
condition not l.startswith("_ =>") and the lambda inside filter that checks not
l.startswith(("//", "match"))), i.e., update both anonymous functions to use
`line` and adjust their bodies to call line.startswith(...) so Flake8 E741 is
resolved while keeping behavior identical.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 35f211ac-982d-48f9-ae6d-dae272ba7f40

📥 Commits

Reviewing files that changed from the base of the PR and between e59d6cd and cf536b7.

⛔ Files ignored due to path filters (2)
  • Lib/_opcode_metadata.py is excluded by !Lib/**
  • Lib/test/test_dis.py is excluded by !Lib/**
📒 Files selected for processing (2)
  • crates/compiler-core/src/bytecode/instruction.rs
  • scripts/generate_opcode_metadata.py

| Self::CallTuple1
| Self::CallType1 => Self::Call {
argc: Arg::marker(),
pub const fn deopt(self) -> Option<Self> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have extracted the specializations depot part of the deoptimize method into a separate one called deopt.
The behavior of deoptimize did not change

Copy link
Contributor

@coderabbitai coderabbitai bot 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: 1

♻️ Duplicate comments (1)
scripts/generate_opcode_metadata.py (1)

75-78: ⚠️ Potential issue | 🟡 Minor

Handle missing deopt() match explicitly before .group(1).

Line 76-Line 78 can fail with a non-actionable AttributeError if the signature changes; raise a clear ValueError instead.

Suggested fix
 def build_deopts(contents: str) -> dict[str, list[str]]:
-    raw_body = re.search(
-        r"fn deopt\(self\) -> Option<Self>(.*)", contents, re.DOTALL
-    ).group(1)
+    deopt_match = re.search(
+        r"fn deopt\(self\) -> Option<Self>(.*)", contents, re.DOTALL
+    )
+    if not deopt_match:
+        raise ValueError("Could not find Instruction.deopt()")
+    raw_body = deopt_match.group(1)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/generate_opcode_metadata.py` around lines 75 - 78, The regex search
in build_deopts currently calls .group(1) on the result of re.search which will
raise an AttributeError if no match is found; instead, capture the match into a
variable, check if it is None, and if so raise a descriptive ValueError (e.g.,
"deopt() signature not found in contents") before accessing group(1); update the
code in build_deopts to use the match variable and raise the clear error to make
failures actionable.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/generate_opcode_metadata.py`:
- Around line 81-83: The lambdas using the ambiguous parameter name "l" (in the
first lambda used with take-until comment "Take until reaching fallback" and the
second lambda passed into filter) should be renamed to a descriptive parameter
like "line" to satisfy Flake8 E741; update both occurrences (the lambda in the
take/until expression and the lambda passed to filter) to use "line" and adjust
any internal references accordingly so behavior is unchanged.

---

Duplicate comments:
In `@scripts/generate_opcode_metadata.py`:
- Around line 75-78: The regex search in build_deopts currently calls .group(1)
on the result of re.search which will raise an AttributeError if no match is
found; instead, capture the match into a variable, check if it is None, and if
so raise a descriptive ValueError (e.g., "deopt() signature not found in
contents") before accessing group(1); update the code in build_deopts to use the
match variable and raise the clear error to make failures actionable.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 357b7761-b806-459d-be4b-25ddced83286

📥 Commits

Reviewing files that changed from the base of the PR and between cf536b7 and 4c9193c.

⛔ Files ignored due to path filters (1)
  • Lib/test/test__opcode.py is excluded by !Lib/**
📒 Files selected for processing (3)
  • crates/compiler-core/src/bytecode/instruction.rs
  • crates/stdlib/src/_opcode.rs
  • scripts/generate_opcode_metadata.py

Comment on lines +81 to +83
lambda l: not l.startswith("_ =>"), # Take until reaching fallback
filter(
lambda l: (
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Rename ambiguous lambda variable l to satisfy lint.

Line 81 and Line 83 trigger Flake8 E741 (ambiguous variable name 'l').

Suggested fix
     body = "\n".join(
         itertools.takewhile(
-            lambda l: not l.startswith("_ =>"),  # Take until reaching fallback
+            lambda line: not line.startswith("_ =>"),  # Take until reaching fallback
             filter(
-                lambda l: (
-                    not l.startswith(
+                lambda line: (
+                    not line.startswith(
                         ("//", "Some(match")
                     )  # Skip comments or start of match
                 ),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
lambda l: not l.startswith("_ =>"), # Take until reaching fallback
filter(
lambda l: (
body = "\n".join(
itertools.takewhile(
lambda line: not line.startswith("_ =>"), # Take until reaching fallback
filter(
lambda line: (
not line.startswith(
("//", "Some(match")
) # Skip comments or start of match
),
🧰 Tools
🪛 Flake8 (7.3.0)

[error] 81-81: ambiguous variable name 'l'

(E741)


[error] 83-83: ambiguous variable name 'l'

(E741)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/generate_opcode_metadata.py` around lines 81 - 83, The lambdas using
the ambiguous parameter name "l" (in the first lambda used with take-until
comment "Take until reaching fallback" and the second lambda passed into filter)
should be renamed to a descriptive parameter like "line" to satisfy Flake8 E741;
update both occurrences (the lambda in the take/until expression and the lambda
passed to filter) to use "line" and adjust any internal references accordingly
so behavior is unchanged.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant