Beauty of Recursion?
Well, there is what I call Mathematical Beauty, and then there is reality.
It is fantastic to prove neat theorems that something is possible by methods
like mathematical induction that in some sense use recursion as in if
something is true for some base value and it can be sh
On Friday, December 31, 2021 at 7:50:48 AM UTC+8, MRAB wrote:
> On 2021-12-30 23:27, hongy...@gmail.com wrote:
> > On Friday, December 31, 2021 at 7:04:24 AM UTC+8, Chris Angelico wrote:
> >> Neither of these wants to be recursive, and writing them recursively
> >> pollutes the function signatur
On 2021-12-30 23:27, hongy...@gmail.com wrote:
On Friday, December 31, 2021 at 7:04:24 AM UTC+8, Chris Angelico wrote:
Neither of these wants to be recursive, and writing them recursively
pollutes the function signature with parameters that really exist just
to be local variables. Passing an ac
On Friday, December 31, 2021 at 7:04:24 AM UTC+8, Chris Angelico wrote:
> Neither of these wants to be recursive, and writing them recursively
> pollutes the function signature with parameters that really exist just
> to be local variables. Passing an accumulator down is a terrible way
> to demo
Hi! I am very new to Python admittedly, but did try several options
regarding troubleshooting to get OpenGL to run with Python. I am using
PyCharm as my interface, did try installing setup tools and have
reinstalled using pip install function a few times. I did notice my machine
seems to be havin
On Fri, Dec 31, 2021 at 9:42 AM hongy...@gmail.com
wrote:
> > (Also, is this REALLY an optimization? Exception handling isn't the
> > fastest. Yes, it avoids some measure of recursion depth, but it looks
> > like a pretty inefficient way to do things. Python is not Lisp, and
> > there are very ver
On Fri, Dec 31, 2021 at 9:42 AM hongy...@gmail.com
wrote:
>
> On Thursday, December 30, 2021 at 11:24:20 PM UTC+8, Chris Angelico wrote:
> > On Fri, Dec 31, 2021 at 2:03 AM hongy...@gmail.com
> > wrote:
> > > See here [1] for the related discussion.
> > >
> > > [1]
> > > https://discuss.python.o
On Thursday, December 30, 2021 at 11:23:35 PM UTC+8, Chris Angelico wrote:
> If it's an exception, it needs to subclass Exception or BaseException.
I see. That is, the following:
class TailRecurseException(Exception):
def __init__(self, args, kwargs):
self.args = args
self.kwargs = kwa
On Thursday, December 30, 2021 at 11:24:20 PM UTC+8, Chris Angelico wrote:
> On Fri, Dec 31, 2021 at 2:03 AM hongy...@gmail.com
> wrote:
> > See here [1] for the related discussion.
> >
> > [1]
> > https://discuss.python.org/t/typeerror-catching-classes-that-do-not-inherit-from-baseexception-
On Fri, Dec 31, 2021 at 2:03 AM hongy...@gmail.com
wrote:
> See here [1] for the related discussion.
>
> [1]
> https://discuss.python.org/t/typeerror-catching-classes-that-do-not-inherit-from-baseexception-is-not-allowed/12800
Why did you post in two places at once? Did you need more people to
t
On Fri, Dec 31, 2021 at 2:00 AM hongy...@gmail.com
wrote:
>
> I try to compute the factorial of a large number with tail-recursion
> optimization decorator in Python3. The following code snippet is converted
> from the code snippet given here [1] by the following steps:
>
> $ pyenv shell datasci
On Thursday, December 30, 2021 at 9:04:36 PM UTC+8, hongy...@gmail.com wrote:
> I try to compute the factorial of a large number with tail-recursion
> optimization decorator in Python3. The following code snippet is converted
> from the code snippet given here [1] by the following steps:
>
> $
I try to compute the factorial of a large number with tail-recursion
optimization decorator in Python3. The following code snippet is converted from
the code snippet given here [1] by the following steps:
$ pyenv shell datasci
$ python --version
Python 3.9.1
$ pip install 2to3
$ 2to3 -w this-scr
13 matches
Mail list logo