Le lun. 30 nov. 2020 à 13:37, Dima Pasechnik <dimp...@gmail.com> a écrit :
>
> On Mon, Nov 30, 2020 at 9:16 AM Vincent Delecroix
> <20100.delecr...@gmail.com> wrote:
> >
> > Le 30/11/2020 à 00:48, slelievre a écrit :
> > > 2020-11-29 21:23:36 UTC, Guillermo:
> > >>
> > >> I wonder what would be wrong with replacing '!' → '.factorial()'
> > >
> > > Interesting idea. Just be careful with `!=` of course.
> > >
> >
> > Indeed the expression "3!=3" is ambiguous... Of course one can choose
> > a priority (3!)=(3) or (3)!=(3) but that would be much more error
> > prone than using .factorial() from the start.
>
> I think .factorial() will do. Perhaps this can be combined with
> looking for deprecation issues vs factorial() and Python 3.9.
>
> From python 3.9 docs:
>
> Currently math.factorial() accepts float instances with non-negative
> integer values (like 5.0).
> It raises a ValueError for non-integral and negative floats. It is now
> deprecated.
> In future Python versions it will raise a TypeError for all floats.
> (Contributed by Serhiy Storchaka in bpo-37315.)
> https://bugs.python.org/issue37315

Dealing with that deprecation is the object of:

- Sage Trac ticket 30764
  Adapt to float factorial deprecation in Python 3.9
  https://trac.sagemath.org/ticket/30764

in case anyone wants to give it a go.

Preparsing `!` to `.factorial()` is orthogonal enough
that I think it deserves its own ticket. I opened

- Sage Trac ticket 30982
  Preparse ! for factorial
  https://trac.sagemath.org/ticket/30982

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/CAEcArF1ZXTbzQb2_scKfO9QyAHh_oXR-QBmXUDL9%2BqG-4__3yA%40mail.gmail.com.

Reply via email to