Repository navigation
Conversation
cjdoris
commented
Nov 8, 2026
cjdoris
commented
Nov 8, 2026
cjdoris
commented
Nov 8, 2026
cjdoris
commented
Nov 8, 2026
This branch has not been deployed
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.
Redesign
pyconvertaround a global Python source-type DAG, destination scopes, stable rule IDs, cached selections, and explicit conversion contexts. Canonical conversions prefer native materialized containers while generic iterators remain lazy. Add source-specific preferences, lazy public type aliases and shorthand such as"list" => PyListand"None" => Missing.Rules and public
pytryconvertshare a normalized result convention:nothingmeans failure, ordinary successes are raw values, and successfulnothing/Somevalues are wrapped once. After checking for failure,something(result)recovers the value. This avoids unnecessary result allocations while preserving concrete and union return bounds. Exceptions propagate.Restrict generic floating-point coercions to Python float/complex sources so integer overflow cannot succeed after rounding through a float. Integral/rational sources retain exact intermediates; supported NumPy scalars retain dedicated rules. Update conversion documentation, migration guidance, and invariant tests.
Validation: 1,812 focused conversion/wrapper/Julia-wrapper checks passed with NumPy installed (one existing optional-dependency skip); 1,694 passed with bare system Python (four expected optional-dependency skips). Full-suite and supported-version coverage run in CI. NumPy-specific tests respect its optional status in external-interpreter jobs.
Reproducible benchmark scripts are included; generated outputs were removed. The latest direct allocation check saves 16 bytes/one allocation for public String, BigInt and array try-conversion; concrete Int/Float64 remain allocation-free. Earlier original-v1 comparisons showed inferred large-vector conversion improving by roughly one third, and array allocation totals matching original v1 after minimal rule-result wrapping. The remaining major measured regression is cold registry rebuilding (~2.6 ms versus ~28 μs in the synthetic fixture), plus slower simple selection misses. Warm calls do not rebuild the DAG.
Related to #661.