GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Match obsolete comparison diagnostics by youknowdot · Pull Request #9074 · RustPython/RustPython

Conversation

@youknowdot

@youknowdot youknowdot commented Oct 10, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Current status

Current head: dd0c42ff332013dff6584e896e70638176008307, targeting main. The current source uses Python 3.15.0, not the older 3.14.8 pin described by earlier revisions. Exact-head hosted checks are complete: 27 succeeded and one conditional benchmark check was skipped; CI succeeded. The prior CI-pause and intermediate-head descriptions are superseded.

This remains a draft because the parser-versus-compiler architecture question is still open. A passing CI run and the token-overlap correction do not settle that design decision.

Scope

  • Emit the obsolete-comparison hint for infix 2 <> 3, with the complete operator span.
  • Keep bare <> a generic syntax error and preserve Barry-mode behavior.
  • Match adjacent, complete < and > tokens rather than a textual substring, so 2 <<> 3 does not incorrectly match the suffix of <<.
  • Keep the Python-visible message/span coverage in the existing extra_tests/snippets/builtin_compile.py, including overlap controls. Existing Rust tests retain structural parsing checks.

Only crates/compiler/src/lib.rs and that existing snippet change. No Lib/ files or parser dependency are changed. The source still uses registry rustpython-ruff_python_parser 0.16.10.

Remaining architecture question

The current implementation lives in the existing compiler BarrySource adapter. It inspects parser tokens and the first parse-error position, then returns its diagnostic before first_parse_error in the compiler and symbol-table paths. This fixes the documented textual-token overlap, but still infers comparison context outside the parser.

A parser-owned diagnostic would let the grammar's comparison production determine context directly. Such a migration would also need to remove or narrow the compiler override so it does not replace the parser's diagnostic. No parser migration is claimed by this patch; maintainer review of that boundary remains necessary.

Validation and history

Exact-head hosted CI is the current validation evidence. This status refresh adds no code and claims no new local runtime or build execution.

The earlier 3.14.8 backport/source-extraction revisions had focused ASCII diagnostic, compiler and Barry-mode checks, normal hooks and scoped Clippy. Those results belong to their historical revisions, not a fresh run of this head. The change originated from the CPython obsolete-operator diagnostic update 66f8dbe0.

AI assistance

Maintainer-requested Python compatibility maintenance. OpenAI Codex assisted with source analysis, code and validation work in the existing commits, and this status/review clarification. Model version unavailable. No additional human manual testing is claimed by this update.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

  • X
  • Mastodon
  • Reddit
  • LinkedIn
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

youknowone
youknowone reviewed Oct 10, 2026
View reviewed changes
Comment thread crates/compiler/src/lib.rs Outdated
if let Some(error) = parse_error
&& let Some(range) = self.invalid_legacy_operator(error)
{
if error.location.start() > range.start() {

@youknowone youknowone Oct 10, 2026

Copy link
Copy Markdown
Member

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.

is this the right place instead of patching parser?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@youknowdot youknowdot Oct 10, 2026

Copy link
Copy Markdown
Contributor Author

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.

The parser is the cleaner place for this diagnostic. I used the existing BarrySource adapter to keep the extraction independent of a parser release, but the review uncovered a real weakness: for 2 <<> 3, the textual match overlaps the << token and incorrectly emits the obsolete-comparison hint. I confirmed that with compile-only CPython 3.14.8/native checks. A comparison-context check in the pinned parser is the appropriate fix; the compiler override must also stop replacing that parser diagnostic. I am checking the narrow dependency path rather than importing the broader parser changes. This draft is not ready in its current form.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@youknowdot youknowdot Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

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.

The parser is still the cleaner owner of this grammar-context diagnostic. The current head, dd0c42f, fixes the concrete 2 <<> 3 overlap by matching complete adjacent tokens instead of searching the source text, and its exact-head CI passes. That does not resolve your architecture question.

The implementation still lives in BarrySource::diagnostic: it combines the token range with the parser's first error location, and the compiler/symbol-table paths call it before first_parse_error. The registry Ruff parser remains at 0.16.10. Moving the diagnostic into the comparison production would therefore also require removing or narrowing this compiler override, so the adapter does not replace the parser's result.

I've corrected the stale PR description and kept this boundary explicit. The PR remains a draft pending that design decision; I haven't made an unrelated parser rewrite. This clarification is AI-assisted with OpenAI Codex (model version unavailable), based on the current source and hosted results.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@youknowdot
youknowdot force-pushed the fix-obsolete-comparison-diagnostic branch from 5b0fac6 to 7b25dc1 Compare October 11, 2026 03:17
@youknowdot youknowdot changed the title Match Python 3.14.8 obsolete comparison diagnostics Match obsolete comparison diagnostics Oct 11, 2026
@youknowdot
youknowdot force-pushed the fix-obsolete-comparison-diagnostic branch from 7b25dc1 to 1c36965 Compare October 11, 2026 03:21
@youknowone
youknowone changed the base branch from main to stack/python-3.15-8950 October 11, 2026 03:26
@youknowdot
youknowdot force-pushed the fix-obsolete-comparison-diagnostic branch from 1c36965 to 0596dee Compare October 11, 2026 04:07
@youknowone
youknowone changed the base branch from stack/python-3.15-8950 to main October 11, 2026 04:09
@youknowdot
youknowdot force-pushed the fix-obsolete-comparison-diagnostic branch from 0596dee to aa02e48 Compare October 11, 2026 04:14
@github-actions

github-actions Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

📦 Library Dependencies

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

[ ] test: cpython/Lib/test/test_mmap.py (TODO: 19)

dependencies:

dependent tests: (2 tests)

  • mmap: test_os
    • multiprocessing.shared_memory: test_genericalias

Legend:

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@youknowdot
youknowdot force-pushed the fix-obsolete-comparison-diagnostic branch from aa02e48 to dd0c42f Compare October 11, 2026 16:48
@youknowone youknowone mentioned this pull request Oct 19, 2026
Use the Ruff fork 0.17.1 for CPython syntax error messages and the obsolete '<>' hint #9212
Merged
This was referenced Oct 21, 2026
Support signed numeric constants in match pattern ASTs #9279
Merged
Integrate remaining Python 3.15 final runtime and libraries #8954
Draft
@codspeed

codspeed Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 62 untouched benchmarks
⏩ 4 skipped benchmarks1


Comparing youknowdot:fix-obsolete-comparison-diagnostic (16773b8) with main (81e3634)

Open in CodSpeed

Footnotes

  1. 4 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codex
Retain obsolete comparison diagnostic regressions on current parser
77ef757
Preserve the final intent of PR RustPython#9074 after its prior main merge: the parser owns diagnostics, and this branch adds only Python-visible regression coverage.

Assisted-by: OpenAI Codex:model identifier unavailable
@youknowdot
youknowdot force-pushed the fix-obsolete-comparison-diagnostic branch from 16773b8 to 77ef757 Compare November 7, 2026 22:28
@youknowone youknowone closed this Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@youknowone youknowone youknowone left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@youknowdot @youknowone @codex
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.