Conversation
- Fix math.factorial: float -> float changed to int -> int for Python 3.12+ compatibility (float args raise TypeError since Python 3.12) - Add missing constants: pi, e, tau, inf, nan - Add missing functions: sqrt, degrees, radians, trunc, hypot, fsum, isqrt, prod, perm, acosh, asinh, atanh, cosh, sinh, tanh, erf, erfc, gamma, lgamma - Fix math.dist signature to accept float arrays (multi-dimensional) - Add tests for all new additions - Update tests to use integer literals for factorial Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace IEnumerable<T> with seq<T> in fsum/prod to fix build (missing import). Add tests for nan, prod, perm, dist, hyperbolic functions, and special functions. Move Unreleased section above rc.3 in CHANGELOG. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced Apr 16, 2026
dbrattli
added a commit
that referenced
this pull request
Apr 16, 2026
Update tests for comb, copysign, fmod, pow, atan2, dist to use tupled calling convention matching the corrected type signatures. Restore PR #251 entries that were dropped from the Unreleased CHANGELOG section. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
dbrattli
added a commit
that referenced
this pull request
Apr 16, 2026
…dings (#253) * fix(math): correct type signatures for copysign, fmod and curried bindings - math.copysign: fix y parameter type from int to float (Python always takes two floats) - math.fmod: fix parameter and return types from int to float (computes floating-point remainder, not integer modulo) - math.comb, math.pow, math.atan2, math.dist: convert curried parameter syntax to tupled for consistency with all other multi-parameter bindings in the codebase Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: update tests for tupled params, restore CHANGELOG entries Update tests for comb, copysign, fmod, pow, atan2, dist to use tupled calling convention matching the corrected type signatures. Restore PR #251 entries that were dropped from the Unreleased CHANGELOG section. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Dag Brattli <dag@brattli.net> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
🤖 This is an automated pull request from Repo Assist.
Problem
Two issues with
Fable.Python.Mathbindings:Bug:
math.factorialhas wrong signature for Python 3.12+The binding declared
abstract factorial: x: float -> float, but Python 3.12 removed float support —math.factorial(5.0)now raisesTypeError: 'float' object cannot be interpreted as an integer. Sincepyproject.tomlrequirespython >= 3.12, this binding (and its test) was broken.Missing constants and functions
The
mathmodule was missing many commonly-used members: the five constants (pi,e,tau,inf,nan), and over a dozen functions (sqrt,degrees,radians,trunc,hypot,fsum,isqrt,prod,perm, hyperbolic functions, and special functions).Fix
factorialsignature toint -> intand updated the test to pass integer literals.pi,e,tau,inf,nan).sqrt,degrees,radians,trunc,hypot,fsum,isqrt,prod,perm,acosh,asinh,atanh,cosh,sinh,tanh,erf,erfc,gamma,lgamma.math.distto acceptfloat[]arrays (the Python function takes two point sequences, not two scalars).IExportsinterface with section comments matching the Python docs structure.Trade-offs
factorial: float -> float→factorial: int -> int, which aligns with the Python 3.12 API. Any F# code passing floats tofactorialwas already broken at runtime.math.distsignature changed fromfloat -> float -> floattofloat[] -> float[] -> float. The old curried scalar version was incorrect (Python'sdisttakes two sequences of coordinates, not two scalars).Checklist
math.factorialsignature (float -> float→int -> int)pi,e,tau,inf,nansqrt,degrees,radians,trunc,hypot,fsum,isqrt,prod,perm, all hyperbolic and special functionsmath.distsignatureTestMath.fsCHANGELOG.mdNote
🔒 Integrity filter blocked 10 items
The following items were blocked because they don't meet the GitHub integrity level.
list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".To allow these resources, lower
min-integrityin your GitHub frontmatter: