Repository navigation
Manual: which rule is tried first, and the canonical order - #2070
Merged
Merged
Conversation
A new tutorial section, "Order of Rules and of Elements": more specific rules are tried first (values before patterns, typed blanks before blanks, _ before __ before ___, conditions, structure), a rule with the same left-hand side replaces the old one, and the canonical order that Sort, Order and Orderless use. Every example is a doctest, and every result matches WMA 15. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pytest 9.2.0 (2026-10-27) breaks pytest-benchmark 5.3.0, the latest release: every benchmark errors with "'Function' object has no attribute '_nodeid'" (ionelmc/pytest-benchmark#321). Since then the benchmark job fails on every pull request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit d00ed4a)
rocky
pushed a commit
that referenced
this pull request
Oct 28, 2026
Since pytest 9.2.0 came out (2026-10-27), the "Run performance benchmarks" job fails on every pull request, including #1989, #2032, #2069 and #2070. All 73 benchmarks error at setup: ``` AttributeError: 'Function' object has no attribute '_nodeid'. Did you mean: 'nodeid'? ``` pytest-benchmark 5.3.0, its latest release, uses a private attribute that pytest 9.2 removed: ionelmc/pytest-benchmark#321, still open. The last passing run (master, 2026-10-27 10:20) had pytest 9.1.1; the failing ones have 9.2.0. pytest-benchmark is 5.3.0 in both. This keeps pytest below 9.2 in the benchmark workflow, with a comment pointing at the upstream issue, so the pin can go once pytest-benchmark is fixed. `pyproject.toml` does not pin pytest, so the later `pip install -e .[dev,full]` keeps 9.1.x. Checked with a one-test benchmark: pytest 9.2.0 + pytest-benchmark 5.3.0 gives the same error, and pytest 9.1.1 + pytest-benchmark 5.3.0 passes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
LGTM - many thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Following the suggestion in #2067 ("the same thing for matching rule and element order precedence"). This adds a new tutorial section to the Manual, "Order of Rules and of Elements", right after "Functions and Patterns".
f[1]comes beforef[x_],x_Integerbeforex_,_before__before___, a conditional rule before the same rule without a condition, and{x_}beforex_Listbeforex_. A rule with the same left-hand side replaces the old one.Sort,OrderandOrderlessuse. Numbers come first, then strings, then symbols, then other expressions. Strings and symbols are ordered without regard to case, with lower case first. Monomials are ordered as the terms of a polynomial, and general expressions by head, then by length, then element by element.Every example is a doctest, and every result was checked against WMA 15. I left out the cases where Mathics3 and WMA differ:
f[x_?EvenQ]andf[x_?PrimeQ]: WMA tries them in the order of definition. That is Wrong order for matching in Rule #1978, and the draft Rule sort refactor #1989 addresses it.Optionaland repeated pattern names.These are listed, with WMA 15 values, in the companion developer's guide page, Mathics3/Mathics3-development-guide#51.
docpipeline.py -c "Language Tutorial": all pass.🤖 Generated with Claude Code