-
-
Notifications
You must be signed in to change notification settings - Fork 454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adapt to float factorial deprecation in Python 3.9 #30764
Comments
comment:2
Is this a pynac issue? I've been trying to understand how factorials work in Sage, and it looks like in the case of floats, it just passes it on to pynac. That is,
|
This comment has been minimized.
This comment has been minimized.
comment:3
I opened a pynac ticket: |
Upstream: Reported upstream. No feedback yet. |
comment:4
maybe the relevant code is here
|
comment:5
Or maybe this goes through the
whose doc says "Python float, Python complex, mpmath mpf and mpc as well as numpy inputs |
comment:6
In python3.9, the code used depends on whether the float is integer-like or not: For For
This then turns again to the module |
Commit: |
Branch: u/chapoton/30764 |
Author: Frédéric Chapoton |
comment:7
Here is a simple proposal, which works. If somebody has a much better idea, please provide an alternative proposal. New commits:
|
comment:8
green bots (one with python 3.7, one with python 3.9), please review |
comment:10
This will work, but I think it would be better to have a little more detailed comment as the current one is lacking context. Perhaps something like:
|
comment:12
ok, I have added (quite verbose) explanations + ref to this ticket |
comment:13
Thank you. |
Reviewer: Travis Scrimshaw |
Changed branch from u/chapoton/30764 to |
Python 3.9 deprecates using
math.factorial
with floats with integral values.https://docs.python.org/3.9/library/math.html#math.factorial
"Deprecated since version 3.9: Accepting floats with integral values (like 5.0) is deprecated."
This gives a doctest failure in Sage 9.2.rc0 with Python 3.9.0:
First discussed in #30184 (comments 25, 33, 40, 41, 42, 43).
Upstream (pynac) report:
Upstream: Reported upstream. No feedback yet.
CC: @jhpalmieri @mkoeppe @slel @tscrim
Component: basic arithmetic
Keywords: factorial
Author: Frédéric Chapoton
Branch/Commit:
e206151
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/30764
The text was updated successfully, but these errors were encountered: