Questions tagged [recursionerror]
31 questions
2
votes
2 answers
Binary Search RecursionError: maximum recursion depth exceeded in comparison
I was trying to execute the Binary Search program in python. I followed the algorithm steps yet it gives me this error. Here's my code:
def binarySearch(a,k,l,r):
if l > r:
return -1
else:
mid = (l+(r-l))//2
…

Raj
- 69
- 1
- 3
- 11
1
vote
2 answers
How to fix a RecursionError in Turtle?
I'm trying to write a program with Python to emulate an 'old' online game in which you drive a worm through the screen with some inputs from the keyboard.
import turtle
# Set screen and background
wn = turtle.Screen()
wn.title("Turn with Left and…

Mira
- 25
- 4
1
vote
1 answer
Recursion Error when Accessing Histograms from Root File using uproot in a Jupyter Notebook
I've made root files with histograms through another program, and I'm trying to extract this histograms in a Jupyter notebook using Python3 to do various bits of analysis on these histograms.
In the past, this has been a non-issue, but I'm on a new…

Chris McLauchlin
- 21
- 2
1
vote
1 answer
Actually simple recursion problem on Python
During coding I came across with this simple recursion problem and I wrote an example of my code below. I ask somebody to find a good way to solve the problem. I guess it is supposed to write third class containing the relations.
from __future__…

numericmaestro
- 15
- 4
1
vote
1 answer
Why is this quicksort overflowing?
I have the following Hy code:
(defn quicksort [lst]
(if (< (len lst) 2)
(return lst)
(do
(setv pivot (// (len lst) 2))
(setv (, under same over) (, [] [] []))
(for [i lst]
(if (< i pivot)
…

Tuor
- 875
- 1
- 8
- 32
0
votes
1 answer
Why can't a reference to a not imported module be made if the same module is imported in error-handling?
Given this python script:
def s():
try:
time.sleep(1)
except NameError:
import time
s()
for i in range(10):
s()
print(i)
This gives me a RecursionError, but I don't see why because I would expect it…

fedsavi
- 3
- 5
0
votes
0 answers
How can I solve RecursionError while visualizing my model?
I'm trying to visualize the importance scores of the data with the following codes in Google Colab and the following error keeps occurring. I tried to adjust hte system recurssion limit but the same error keeps on occurring. Can anybody…

Youngjae Song
- 1
- 1
0
votes
1 answer
Turtle crashing after many moves
I'm messing around with recursion and decided to turtle. I'm trying to get some code to build a Sierpenski Triangle and it's working pretty well so far! However, when I plug in larger values of n to my function to get more detailed triangles, it…

shan
- 3
- 2
0
votes
2 answers
i dont know what caused this Recursion Error
I am making a customtkinter game that is basically Cookie Clicker but themed around beans. and by suggestions from another thread I added Threading, which I'm having a hard time implementing, and multiple classes, which I don't understand how to…

T.E.G Studios
- 3
- 3
0
votes
0 answers
AttributeError and RecursionError happened when using `__setattr__` in python
I used super() as a part of the __setattr__ method to update a dictionary whenever an attribute value is set on an instance of a class; however, a warning reported as my class object has no such attribute '_attributes'. The code just like…

Karenzz
- 1
0
votes
0 answers
Airflow not loading DAGs after upgrading to 2.4.2 or higher
I have perfectly configured Airflow v2.4.1 application working over Docker, which when upgraded to v2.4.2 or higher fails to load DAGs. I tried every possible solutions but no use.
When playing around with airflow.cfg file, considering the error…

PrashanjeetH
- 3
- 1
0
votes
0 answers
R reticulate: Error in py_call_impl(callable, dots$args, dots$keywords): RecursionError: maximum recursion depth exceeded
I have the following python function to extract unique object names in an AWS S3 bucket, and it passed the test runs in python:
###############################
# aws_get_session_name_fuc.py #
###############################
def get_session_names(s3,…

Y Ming
- 27
- 7
0
votes
1 answer
Implementing heap sort algorithm in Python receiving recursion error when running
Im trying to implement the heap sort algorithm to sort a list but receiving the following error code:
RecursionError: maximum recursion depth exceeded
Please let me know if you find any issues I will post my functions and helper functions below as…

Anon
- 1
0
votes
0 answers
How to solve RecursionError without sys.setrecursionlimit() in python
I have implemented recursive functions that work on big database and it raises
RecursionError: maximum recursion depth exceeded while calling a Python object
To solve it I added sys.setrecursionlimit(10 ** 4) at the beginning of my code.
But now,…

Tom Lai
- 1
- 2
0
votes
1 answer
Python - RecursionError - maximum recursion depth exceeded
I'm a student working on this homework problem. The code tries to find a solution to any given circular board game, where a list is given as an argument. The values in the list tell the program how far to move clockwise/counterclockwise (last…