[Python-ideas] Re: A better math.factorial

2021-09-16 Thread Steven D'Aprano
On Thu, Sep 16, 2021 at 06:33:58PM -, Jonatan wrote: > Currently, math.factorial only supports integers and not floats, > whereas the "mathematical" version supports both integers and floats. That's questionable. (Warning: maths geek post follows.) Mathematicians typically only use the n

[Python-ideas] Re: A better math.factorial

2021-09-16 Thread Jonathan Sh.
Not really, That was the first option that came to my mind. ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message arch

[Python-ideas] Re: A better math.factorial

2021-09-16 Thread Damian Shaw
Is there a reason you defined it as n * math.gamma(n), instead of math.gamma(n+1)? Damian (he/him) On Thu, Sep 16, 2021 at 2:35 PM Jonatan wrote: > Currently, math.factorial only supports integers and not floats, whereas > the "mathematical" version supports both integers and floats. > I.e: > `

[Python-ideas] A better math.factorial

2021-09-16 Thread Jonatan
Currently, math.factorial only supports integers and not floats, whereas the "mathematical" version supports both integers and floats. I.e: ``` import math def better_factorial(n): return n * math.gamma(n) print(math.factorial(10) == better_factorial(10)) ``` This ends up in `True`, as tha

[Python-ideas] Re: os.workdir() context manager

2021-09-16 Thread Jeremiah Paige
On Wed, Sep 15, 2021 at 4:20 AM Steven D'Aprano wrote: > On Wed, Sep 15, 2021 at 08:53:21PM +1000, Chris Angelico wrote: > > > Sometimes there is no valid path to something, > > I don't understand what you mean by that. If there is no valid path to > something, where exactly are you cd'ing to, an

[Python-ideas] Re: Python Documentation in Bengali (translation)

2021-09-16 Thread Sharif Mehedi
Thank you Julien -- Sharif ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org

[Python-ideas] Re: Python Documentation in Bengali (translation)

2021-09-16 Thread Sharif Mehedi
Thank you Steve -- Sharif ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org