Меню

Ошибка maximum recursion depth exceeded while calling a python object

I’ve built a crawler that had to run on about 5M pages (by increasing the url ID) and then parses the pages which contain the info’ I need.

after using an algorithm which run on the urls (200K) and saved the good and bad results I found that the I’m wasting a lot of time. I could see that there are a a few returning subtrahends which I can use to check the next valid url.

you can see the subtrahends quite fast (a little ex’ of the few first «good IDs») —

510000011 # +8
510000029 # +18
510000037 # +8
510000045 # +8
510000052 # +7
510000060 # +8
510000078 # +18
510000086 # +8
510000094 # +8
510000102 # +8
510000110 # etc'
510000128
510000136
510000144
510000151
510000169
510000177
510000185
510000193
510000201

after crawling about 200K urls which gave me only 14K good results I knew I was wasting my time and need to optimize it, so I run some statistics and built a function that will check the urls while increasing the id with 818178 (top returning subtrahends ) etc’.

this is the function —

def checkNextID(ID):
    global numOfRuns, curRes, lastResult
    while ID < lastResult:
        try:
            numOfRuns += 1
            if numOfRuns % 10 == 0:
                time.sleep(3) # sleep every 10 iterations
            if isValid(ID + 8):
                parseHTML(curRes)
                checkNextID(ID + 8)
                return 0
            if isValid(ID + 18):
                parseHTML(curRes)
                checkNextID(ID + 18)
                return 0
            if isValid(ID + 7):
                parseHTML(curRes)
                checkNextID(ID + 7)
                return 0
            if isValid(ID + 17):
                parseHTML(curRes)
                checkNextID(ID + 17)
                return 0
            if isValid(ID+6):
                parseHTML(curRes)
                checkNextID(ID + 6)
                return 0
            if isValid(ID + 16):
                parseHTML(curRes)
                checkNextID(ID + 16)
                return 0
            else:
                checkNextID(ID + 1)
                return 0
        except Exception, e:
            print "somethin went wrong: " + str(e)

what is basically does is -checkNextID(ID) is getting the first id I know that contain the data minus 8 so the first iteration will match the first «if isValid» clause (isValid(ID + 8) will return True).

lastResult is a variable which saves the last known url id, so we’ll run until numOfRuns is

isValid() is a function that gets an ID + one of the subtrahends and returns True if the url contains what I need and saves a soup object of the url to a global varibale named — ‘curRes‘, it returns False if the url doesn’t contain the data I need.

parseHTML is a function that gets the soup object (curRes), parses the data I need and then saves the data to a csv, then returns True.

if isValid() returns True, we’ll call parseHTML() and then try to check the next ID+the subtrahends (by calling checkNextID(ID + subtrahends), if none of them will return what I’m looking for I’ll increase it with 1 and check again until I’ll find the next valid url.

you can see the rest of the code here

after running the code I got about 950~ good results and suddenly an exception had raised —

«somethin went wrong: maximum recursion depth exceeded while calling a
Python object»

I could see on WireShark that the scipt stuck on id — 510009541 (I started my script with 510000003), the script tried getting the url with that ID a few times before I noticed the error and stopped it.

I was really exciting to see that I got the same results but 25x-40x times faster then my old script, with fewer HTTP requests, it’s very precise, I have missed only 1 result for 1000 good results, which is find by me, it’s impossible to rum 5M times, I had my old script running for 30 hours and got 14-15K results when my new script gave me 960~ results in 5-10 minutes.

I read about stack limitations, but there must be a solution for the algorithm I’m trying to implement in Python (I can’t go back to my old «algorithm», it will never end).

Thanks!

A Recursive function in programming is a function which calls itself. These functions find applications while constructing programs for factorial, Fibonacci series, Armstrong numbers, etc. The main idea is to break larger programs into smaller, less complex problems. With recursive functions, generating sequences becomes easy. But while using recursive functions, recursionerror may occur in python. In this article, we shall be looking into one such recursionerror: maximum recursion depth exceeded while calling a Python object

What is recursionerror?

As the name suggests, Recursionerror may occur when we are dealing with recursive functions. When we run the recursion function for a large number of times, recursion error is thrown. Python has a limit on the number of times a recursive function can call itself. This is done to ensure that the function does not execute infinitely and stops after some number of iterations. To know the recursion limit in python, we use the following code:

import sys
print(sys.getrecursionlimit())

The output is:

1000

Let us look at an example of RecursionError: maximum recursion depth exceeded. We shall take an example of a factorial function.

The following code shall generate factorial for a given number.

def find_fact(n):
  if n == 0 or n == 1:
    return 1
  else :
    return (n*find_fact(n-1))  

print("Factorial is :", find_fact(5))

Here, this program shall be executed successfully and shall print the below output:

Factorial is : 120

But if we pass a larger number into the find_fact() function, it will throw RecursionError: Maximum Recursion Depth Exceeded error.

print("Factorial is :", find_fact(5000))

Output:

RecursionError: maximum recursion depth exceeded in comparison

Since the recursion function exceeded the limit of 1000 iterations, recursionerror is thrown.

The RecursionError: Maximum Recursion Depth Exceeded error may also be thrown while we are trying to create a nested list whose length exceeds the recursion limit.

Let us take the following example. We have created a function named nested() which accepts one argument – n. Depending on the value of n, the length of that nested list would be created. Let us try to pass a value n greater than the recursion limit.

def nested(n): 
    list1 = list2 = [] 
    for i in range(n): 
        list1.append([])
        list1 = list1[0] 
    return list2

nestedlist = nested(2000)
print(nestedlist)

The output will be a recursion error.

RecursionError: maximum recursion depth exceeded while getting the repr of an object

RecursionError: Maximum Recursion Depth Exceeded While Calling A Python Object

The recursionerror for Maximum Recursion Depth Exceeded While Calling A Python Object is thrown when we are trying to call a python object in Django. The error may also occur while using Flask.

When the interpreter detects that the maximum depth for recursion has reached, it throws the recursionerror. To prevent the stack from getting overflow, python raises the recursionerror.

Best practices to avoid RecursionError: Maximum Recursion Depth Exceeded while calling a Python Object

1. Using other loops instead of recursion

To prevent the error from occurring, we can simply convert the piece of code from recursion to a loop statement.

If we take the example of the factorial function, we can convert it into a non – recursive function. We do that by placing a for loop inside the recursion function. The for loop will execute for a length equal to the value of the factorial number.

def find_fact(n):
  mul = 1
  for i in range(2,n+1):
    mul = mul * i
  return mul

print("Factorial is :", find_fact(1500))

Now, it will not throw any recursion error and simply print the large factorial number.

2. Using sys.setrecursionlimit() function

Else, if we still want to use the recursion function, we can increase the recursion limit from 1000 to a higher number. For that, we have to first import the sys library. Using the sys library, we will use the sys.setrecursionlimit() function.

import sys
sys.setrecursionlimit(2000)

Now, it will not thrown the recursionerror and the program will be executed for larger amount of recursions. On executing the recursive function, it will not throw any error and print its output.

def find_fact(n):
  if n == 0 or n == 1:
    return 1
  else :
    return (n*find_fact(n-1))  

print("Factorial is :", find_fact(1500))

3. Setting boundary conditions

It is necessary to set boundary conditions to ensures that the recursive function comes to an end. In the factorial program, the condition :

'if n == 1 or n == 0 : return 1'

is the boundary condition. It is with this condition that the loop comes to an end.

4. Creating a converging recursion

While writing the recursion condition, one has to ensure that the condition does come to an end and does not continue infinitely. The recursive calls should eventually tend towards the boundary condition.

We have to ensure that we creating a converging condition for that. In the factorial program, the ‘n*fact(n-1)’ is a converging condition that converges the value from n to 1.

5. Using Memoization

We can also use memoization to reduce the computing time of already calculated values. This way, we can speed up the calculations by remembering past calculations.

When recursive calls are made, then with memoization we can store the previously calculated values instead of unnecessarily calculating them again.


That sums up the article on RecursionError: Maximum Recursion Depth Exceeded While Calling A Python Object. If you have any questions in your mind, don’t forget to let us know in the comments below.

Until next time, Keep Learning!

  • [Fixed] Module Seaborn has no Attribute Histplot Error

  • [Fixed] JavaScript error: IPython is Not Defined

  • [Fixed] “io.unsupportedoperation not readable” Error

  • [Fixed] “Index Object Has No Attribute tz_localize” Error

You might have seen a Python recursion error when running your Python code. Why does this happen? Is there a way to fix this error?

A Python RecursionError exception is raised when the execution of your program exceeds the recursion limit of the Python interpreter. Two ways to address this exception are increasing the Python recursion limit or refactoring your code using iteration instead of recursion.

Let’s go through some examples so you can understand how this works.

The recursion begins!

Let’s create a program to calculate the factorial of a number following the formula below:

n! = n * (n-1) * (n-2) * ... * 1

Write a function called factorial and then use print statements to print the value of the factorial for a few numbers.

def factorial(n):
    if n == 0:
        return 1
    else:
        return n*factorial(n-1) 

This is a recursive function…

A recursive function is a function that calls itself. Recursion is not specific to Python, it’s a concept common to most programming languages.

You can see that in the else statement of the if else we call the factorial function passing n-1 as parameter.

The execution of the function continues until n is equal to 0.

Let’s see what happens when we calculate the factorial for two small numbers:

if __name__ == '__main__': 
    print("The factorial of 4 is: {}".format(factorial(4)))
    print("The factorial of 5 is: {}".format(factorial(5)))

[output]
The factorial of 4 is: 24
The factorial of 5 is: 120 

After checking that __name__ is equal to ‘__main__’ we print the factorial for two numbers.

It’s all good.

But, here is what happens if we calculate the factorial of 1000…

print("The factorial of 1000 is: {}".format(factorial(1000)))

[output]
Traceback (most recent call last):
  File "recursion_error.py", line 9, in <module>
    print("The factorial of 1000 is: {}".format(factorial(1000)))
  File "recursion_error.py", line 5, in factorial
    return n*factorial(n-1)
  File "recursion_error.py", line 5, in factorial
    return n*factorial(n-1)
  File "recursion_error.py", line 5, in factorial
    return n*factorial(n-1)
  [Previous line repeated 995 more times]
  File "recursion_error.py", line 2, in factorial
    if n <= 1:
RecursionError: maximum recursion depth exceeded in comparison 

The RecursionError occurs because the Python interpreter has exceeded the recursion limit allowed.

The reason why the Python interpreter limits the number of times recursion can be performed is to avoid infinite recursion and hence avoid a stack overflow.

Let’s have a look at how to find out what the recursion limit is in Python and how to update it.

What is the Recursion Limit in Python?

Open the Python shell and use the following code to see the value of the recursion limit for the Python interpreter:

>>> import sys
>>> print(sys.getrecursionlimit())
1000 

Interesting…the limit is 1000.

To increase the recursion limit to 1500 we can add the following lines at the beginning of our program:

import sys
sys.setrecursionlimit(1500)

If you do that and try to calculate again the factorial of 1000 you get a long number back (no more errors).

The factorial of 1000 is: 4023872600770937735437024339230039857193748642107146325437999104299385123986290205920
.......835777939410970027753472000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

That’s good! But…

…this solution could work if like in this case we are very near to the recursion limit and we are pretty confident that our program won’t end up using too much memory on our system.

How to Catch a Python Recursion Error

One possible option to handle the RecursionError exception is by using try except.

It allows to provide a clean message when your application is executed instead of showing an unclear and verbose exception.

Modify the “main” of your program as follows:

if __name__ == '__main__':
    try:
        print("The factorial of 1000 is: {}".format(factorial(1000)))
    except RecursionError as re:
        print("Unable to calculate factorial. Number is too big.") 

Note: before executing the program remember to comment the line we have added in the section before that increases the recursion limit for the Python interpreter.

Now, execute the code…

You will get the following when calculating the factorial for 1000.

$ python recursion_error.py
Unable to calculate factorial. Number is too big. 

Definitely a lot cleaner than the long exception traceback.

Interestingly, if we run our program with Python 2.7 the output is different:

$ python2 recursion_error.py 
Traceback (most recent call last):
  File "recursion_error.py", line 13, in <module>
    except RecursionError as re:
NameError: name 'RecursionError' is not defined 

We get back a NameError exception because the exception of type RecursionError is not defined.

Looking at the Python documentation I can see that the error is caused by the fact that the RecursionError exception was only introduced in Python 3.5:

RecursionError Python

So, if you are using a version of Python older than 3.5 replace the RecursionError with a RuntimeError.

if __name__ == '__main__':
    try:
        print("The factorial of 1000 is: {}".format(factorial(1000)))
    except RuntimeError as re:
        print("Unable to calculate factorial. Number is too big.") 

In this way our Python application works fine with Python2:

$ python2 recursion_error.py
Unable to calculate factorial. Number is too big. 

How Do You Stop Infinite Recursion in Python?

As we have seen so far, the use of recursion in Python can lead to a recursion error.

How can you prevent infinite recursion from happening? Is that even something we have to worry about in Python?

Firstly, do you think the code we have written to calculate the factorial could cause an infinite recursion?

Let’s look at the function again…

def factorial(n):
    if n == 0:
        return 1
    else:
        return n*factorial(n-1) 

This function cannot cause infinite recursion because the if branch doesn’t make a recursive call. This means that the execution of our function eventually stops.

We will create a very simple recursive function that doesn’t have an branch breaking the recursion…

def recursive_func():
    recursive_func()

recursive_func() 

When you run this program you get back “RecursionError: maximum recursion depth exceeded”.

$ python recursion_error2.py
Traceback (most recent call last):
  File "recursion_error2.py", line 4, in <module>
    recursive_func()
  File "recursion_error2.py", line 2, in recursive_func
    recursive_func()
  File "recursion_error2.py", line 2, in recursive_func
    recursive_func()
  File "recursion_error2.py", line 2, in recursive_func
    recursive_func()
  [Previous line repeated 996 more times]
RecursionError: maximum recursion depth exceeded

So, in theory this program could have caused infinite recursion, in practice this didn’t happen because the recursion depth limit set by the Python interpreter prevents infinite recursion from occurring.

How to Convert a Python Recursion to an Iterative Approach

Using recursion is not the only option possible. An alternative to solve the RecursionError is to use a Python while loop.

We are basically going from recursion to iteration.

def factorial(n):
    factorial = 1

    while n > 0:
        factorial = factorial*n
        n = n - 1

    return factorial

Firstly we set the value of the factorial to 1 and then at each iteration of the while loop we:

  • Multiply the latest value of the factorial by n
  • Decrease n by 1

The execution of the while loop continues as long as n is greater than 0.

I want to make sure that this implementation of the factorial returns the same results as the implementation that uses recursion.

So, let’s define a Python list that contains a few numbers. Then we will calculate the factorial of each number using both functions and compare the results.

We use a Python for loop to go through each number in the list.

Our program ends as soon as the factorials calculated by the two functions for a given number don’t match.

def factorial(n):
    factorial = 1

    while n > 0:
        factorial = factorial*n
        n = n - 1

    return factorial

def recursive_factorial(n):
    if n == 0:
        return 1
    else:
        return n*factorial(n-1)

numbers = [4, 9, 18, 23, 34, 56, 78, 88, 91, 1000] 

for number in numbers:
    if factorial(number) != recursive_factorial(number):
        print("ERROR: The factorials calculated by the two functions for the number {} do not match.".format(number))

print("SUCCESS: The factorials calculated by the two functions match") 

Let’s run our program and see what we get:

$ python factorial.py
SUCCESS: The factorials calculated by the two functions match 

Great!

Our implementation of the factorial using an iterative approach works well.

Conclusion

In this tutorial we have seen why the RecursionError occurs in Python and how you can fix it.

Two options you have are:

  • Increase the value of the recursion limit for the Python interpreter.
  • Use iteration instead of recursion.

Which one are you going to use?

Related posts:

I’m a Tech Lead, Software Engineer and Programming Coach. I want to help you in your journey to become a Super Developer!

The maximum recursion depth in Python is 1000.

You can verify this by calling sys.getrecursionlimit() function:

import sys

print(sys.getrecursionlimit()) # Prints 1000

You can change the limit by calling sys.setrecursionlimit() method.

For example:

import sys

print(sys.setrecursionlimit(2000))

Consider this a dangerous action!

If possible, instead of tweaking the recursion limit, try to implement your algorithm iteratively to avoid deep recursion.

Python Maximum Recursion Depth Exceded in Comparison

Whenever you exceed the recursion depth of 1000, you get an error in Python.

For example, if we try to compute a too large Fibonacci number, we get the recursion depth error.

# A function for computing Fibonacci numbers
def fibonacci(n):
   if n <= 1:
       return n
   else:
       return(fibonacci(n-1) + fibonacci(n-2))

# Let's call the 1000th Fibonacci number:
print(fibonacci(1000))

Output:

  File "example.py", line 2, in fibonacci
    if n <= 1:
RecursionError: maximum recursion depth exceeded in comparison

This error says it all—maximum recursion depth exceeded in comparison. This tells you that Python’s recursion depth limit of 1000 is reached.

But why is there such a limit? More importantly, how can you overcome it?

Let’s answer these questions next.

Why Is There a Recursion Depth Limit in Python

A recursive function could call itself indefinitely. In other words, you could end up with an endless loop.

Also, a stack overflow error can occur even if the recursion is not infinite. This can happen due to too big of a stack frame.

In Python, the recursion depth limit takes these risks out of the equation.

Python uses a maximum recursion depth of 1000 to ensure no stack overflow errors and infinite recursions are possible.

This recursion limit is somewhat conservative, but it is reasonable as stack frames can become big in Python.

What Is a Stack Overflow Error in Python

Stack overflow error is usually caused by too deep (or infinite) recursion.

This means a function calls itself so many times that the space needed to store the information related to each call is more than what fits on the stack.

How to Change the Recursion Depth Limit in Python—Danger Zone!

You can change the maximum recursion depth in Python. But consider it a dangerous action.

To do this, call the sys.setrecursionlimit() function.

For example, let’s set the maximum recursion depth to 2000:

import sys

print(sys.setrecursionlimit(2000))

Temporarily Change the Recursion Depth Limit in Python

Do you often need to tweak the recursion depth limit in your project?

If you do, consider using a context manager. This can improve the quality of your code.

For example, let’s implement a context manager that temporarily switches the recursion limit:

import sys

class recursion_depth:
    def __init__(self, limit):
        self.limit = limit
        self.default_limit = sys.getrecursionlimit()

    def __enter__(self):
        sys.setrecursionlimit(self.limit)

    def __exit__(self, type, value, traceback):
        sys.setrecursionlimit(self.default_limit)

Now you can temporarily change the recursion depth to perform a recursive task.

For instance:

with recursion_depth(2000):
    print(fibonacci(1000, 0))

When this operation completes, the context manager automatically switches the recursion depth limit back to the original value.

Learn more about the with statement and context managers in Python here.

Conclusion

The recursion depth limit in Python is by default 1000. You can change it using sys.setrecursionlimit() function.

Thanks for reading. I hope you enjoy it.

Happy coding!

Further Reading

Python Interview Questions and Answers

Useful Advanced Features of Python

Resources

StackOverflow

About the Author

I’m an entrepreneur and a blogger from Finland. My goal is to make coding and tech easier for you with comprehensive guides and reviews.

Recent Posts

In Python, Recursion functions are those functions that call themself inside their function definition. Python limits the number of times a recursion function can call itself, and if the recursion function exceed that limit, Python raise the error

RecursionError: maximum recursion depth exceeded while calling a Python object

.

In this Python guide, we will discuss this error in detail and see learn how to debug it. We will also walk through an example in order to demonstrate this error. So let’s get started with the Error statement.

Python supporters the concept of

Recursion functions

, in which a function can call itself, again and again, until a base condition gets satisfied or it encounters the return statement. If during the recursion process the base condition does not get satisfied or it could not find the return statement, the recursion function will act as an infinite loop.

But calling a function occupies space in the memory, and calling a function inside a function for infinite times can occupy almost every part of your computer memory, to tackle this problem Python has implemented a Recursion Depth limit.

According to this Python recursion depth limit, by default, a recursion function can all itself only 1000 times. And if the recursion exceeds this limit the Python interpreter throws the error



RecursionError: maximum recursion depth exceeded while calling a Python object

.


To know the default Recursion limit for your program you can use the Python sys modules

getrecursionlimit()

method.


Example

import sys

print("This default recursion limit is :", sys.getrecursionlimit())


Output

This default recursion limit is : 1000

If we look at the recursion error statement we can divide it into two parts

  1. RecursionError
  2. maximum recursion depth exceeded while calling a Python object


1. RecursionError

RecursionError is one of the Python standard Exceptions. It is a module exception that comes under the Python RuntimeError. This exception is raised in a Python program when the Python interpreter detects a maximum recursion depth.


2. maximum recursion depth exceeded while calling a Python object

The »

maximum recursion depth exceeded while calling a Python object

» statement is the error message that tags along with the RecursionError exception. This error message is telling us that we a Python function has exceeded the specified or default recursion calls.


Common Example Scenario

Let’s say you need to

write a program

in Python that prints the

nth

number from a Fibonacci series. And you need to write this Python program using recursion. Although this program can easily be created using for loop, but for now we are assuming you are learning recursion and this is your task. The first two numbers of the Fibonacci series are 0 and 1 and the next numbers in the series are calculated with the sum of its previous two numbers.

In the Python program we create there we take a number

n

that represent the n number of the Fibonacci series


Example

# recursive function to find the nth fibonacci number
def n_fibonacci(n):
    if n==0:
        return 0
    elif n==1:
        return 1
    else:
        return n_fibonacci(n-1)+n_fibonacci(n-2)
#
n=10

print(f"the {n}st/nd/th fibonacci number is: ",n_fibonacci(n-1))


Output

the 10st/nd/th fibonacci number is: 34

The above program is absolutely correct, and it also shows the correct output as well. But if we change the value from

n=10

to

n=1005

it will raise the Error.


Example Example

# recursive function to find the nth fibonacci number
def n_fibonacci(n):
    if n==0:
        return 0
    elif n==1:
        return 1
    else:
        return n_fibonacci(n-1)+n_fibonacci(n-2)
#out of the recursion range
n=1005

print(f"the {n}st/nd/th fibonacci number is: ",n_fibonacci(n-1))


Output

RecursionError: maximum recursion depth exceeded in comparison

Here you can see that we are receiving the RecursionError with a different Error message, this is because the error message changes according to the operation we are performing inside the function.

Here it is showing

»

maximum recursion depth exceeded in comparison

»

because after exceeding the recursion limit the python interpreter is also not able to perform the comparison operator inside the recursion.


Solution

Python provide a

setrecursionlimit()

method that accepts an integer value as an argument and set it as a recursion limit for the program. We can use this method to increase the default depth limit of the recession for our program.


Note:

The

setrecursionlimit()

method is also limited and can only increse the recursion limit depth to 3500.

To solve the above example we can increase the limit of recursion to 2000 using the

setrecursionlimit()

method


Example Solution

import sys
# increase the recursion limit
sys.setrecursionlimit(2000)

# recursive function to find the nth fibonacci number
def n_fibonacci(n):
    if n==0:
        return 0
    elif n==1:
        return 1
    else:
        return n_fibonacci(n-1)+n_fibonacci(n-2)
#now in recursion range
n=1005

print(f"the {n}st/nd/th fibonacci number is: ",n_fibonacci(n-1))


Output

the 1005 st/nd/th fibonacci number is: 482051511617926448416241857411039626258600330733909004920469712704382351844831823569922886993050824175326520025449797859766560885196970738202943545195859929088936259370887605815413541849563887924611727164704130

When you execute the above program it may take 10 to 20 minutes to complete because calling a function again and again for 2000 times takes time.


Wrapping Up!

The

RecursionError

occur in a Python program when a recursion call exceeds the default or specified recursion depth limit. When you encounter this error in your Python program, the first thing you should consider is using an iterative approach to solve the problem. Because using iterative statements like

for

and

while

loop we can perform the iterative action quickly and efficiently.

If you have to solve your problem with a recursive way only, in that case, you can use the

setrecursivelimit()

to increase the default depth of the recursion call. If you are still getting this error in your python program, you can share your code in the comment section. We will try to help you in debugging.


People are also reading:

  • Python FileNotFoundError: [Errno 2] No such file or directory Solution

  • How to Remove Last Character from Python String?

  • Python SyntaxError: non-default argument follows default argument Solution

  • What is CubicWeb in Python?

  • Python TypeError: cannot unpack non-iterable NoneType object Solution

  • What is Python Pickle Module?

  • Python IndentationError: expected an indented block Solution

  • What is Web2Py in Python?

  • Python NameError: name ‘self’ is not defined Solution

  • What is TurboGears in Python?

Table of Contents
Hide
  1. What is Recursion?
  2. A classic example of recursion
  3. Why does Python throw maximum recursion depth exceeded in comparison?
  4. How to check maximum recursion depth in Python?
  5. How do you fix the Recursionerror maximum recursion depth exceeded while calling a Python Object?
  6. Closing thoughts

Before jumping into an error, maximum recursion depth exceeded in comparison. Let’s first understand the basics of recursion and how recursion works in Python.

What is Recursion?

Recursion in computer language is a process in which a function calls itself directly or indirectly, and the corresponding function is called a recursive function. 

A classic example of recursion

The most classic example of recursive programming everyone would have learned the factorial of a number. Factorial of a number is the product of all positive integers less than or equal to a given positive integer.

For example, factorial(5) is 5*4*3*2*1, and factorial(3) is 3*2*1. 

Similarly, you can use recursive in many other scenarios like the Fibonacci seriesTower of HanoiTree TraversalsDFS of Graph, etc.

As we already know, recursive functions call by itself directly or indirectly, and during this process, the execution should go on infinitely.

Python limits the number of times a recursive function can call by itself to ensure it does not execute infinitely and cause a stack overflow error.

How to check maximum recursion depth in Python?

You can check the maximum recursion depth in Python using the code sys.getrecursionlimit(). Python doesn’t have excellent support for recursion because of its lack of TRE (Tail Recursion Elimination). By default, the recursion limit set in Python is 1000.

def fibonacci(n):
	if n <= 1:
		return n
	else:
		return(fibonacci(n-1) + fibonacci(n-2))
print(fibonacci(1500))

#Output RecursionError: maximum recursion depth exceeded in comparison

How do you fix the Recursionerror maximum recursion depth exceeded while calling a Python Object?

Let’s write a recursive function to calculate the Fibonacci series for a given number.

Since you are finding a Fibonacci of 1500 and the default recursion limit in Python is 1000, you will get an error stating “RecursionError: maximum recursion depth exceeded in comparison.”

This can be fixed by increasing the recursion limit in Python, below is the snippet on how you can increase the recursion limit.

import sys
sys.setrecursionlimit(1500)

Closing thoughts

This code sets the maximum recursion depth to 1500, and you could even change this to a higher limit. However, it is not recommended to perform this operation as the default limit is mostly good enough, and Python isn’t a functional language, and tail recursion is not a particularly efficient technique. Rewriting the algorithm iteratively, if possible, is generally a better idea.

Avatar Of Srinivas Ramakrishna

Srinivas Ramakrishna is a Solution Architect and has 14+ Years of Experience in the Software Industry. He has published many articles on Medium, Hackernoon, dev.to and solved many problems in StackOverflow. He has core expertise in various technologies such as Microsoft .NET Core, Python, Node.JS, JavaScript, Cloud (Azure), RDBMS (MSSQL), React, Powershell, etc.

Sign Up for Our Newsletters

Subscribe to get notified of the latest articles. We will never spam you. Be a part of our ever-growing community.

By checking this box, you confirm that you have read and are agreeing to our terms of use regarding the storage of the data submitted through this form.

Recursive functions, without limits, could call themselves indefinitely. If you write a recursive function that executes over a certain number of iterations, you’ll encounter the “maximum recursion depth exceeded in comparison” Python error.

This guide discusses what this error means and why it is important. We’ll walk through an example of this error so you can learn how to fix it in your program.

Get offers and scholarships from top coding schools illustration

Find Your Bootcamp Match

  • Career Karma matches you with top tech bootcamps
  • Access exclusive scholarships and prep courses

Select your interest

First name

Last name

Email

Phone number

By continuing you agree to our Terms of Service and Privacy Policy, and you consent to receive offers and opportunities from Career Karma by telephone, text message, and email.

maximum recursion depth exceeded in comparison

Recursive functions are functions that call themselves to find a solution to a program.

Well-written recursive functions include limits to ensure they do not execute infinitely. This may mean that a function should only run until a particular condition is met.

If you write a recursive function that executes more than a particular number of iterations (usually 997), you’ll see an error when you get to the next iteration.

This is because Python limits the depth of a recursion algorithm. This refers to how many times the function can call itself.

You can view the recursion limit in your Python shell using this code:

import sys
print(sys.getrecursionlimit())

An Example Scenario

Let’s write a recursive function that calculates a number in the Fibonacci Sequence. In the Fibonacci Sequence, the next number in the sequence is the sum of the last two numbers. The first two numbers in the sequence are 0 and 1.

Here is a recursive function that calculates the Fibonacci Sequence:

def fibonacci(n):
	if n <= 1:
		return n
	else:
		return(fibonacci(n-1) + fibonacci(n-2))

If the number we specify is less than or equal to 1, that number is returned. Otherwise, our program calculates the next number in the sequence.

Next, we’re going to call our function:

print(fibonacci(5000))

This code calculates the number after the 5,000th number in the Fibonacci Sequence. Let’s run our code and see what happens:

Traceback (most recent call last):
  File "main.py", line 7, in <module>
	print(recur_fibo(5000))
  File "main.py", line 5, in recur_fibo
	return(recur_fibo(n-1) + recur_fibo(n-2))
… 
  File "main.py", line 2, in recur_fibo
	if n <= 1:
RecursionError: maximum recursion depth exceeded in comparison

Our code returns a long error message. This message has been shortened for brevity.

The Solution

Python has raised a recursion error to protect us against a stack overflow. This is when the pointer in a stack exceeds the stack bound. Without this error, our program would try to use more memory space than was available.

We can fix this error by either making our sequence iterative, or by increasing the recursion limit in our program.

Solution #1: Use an Iterative Algorithm

We can change our program to use an iterative approach instead of a recursive approach:

to_calculate = 5
i = 0
next = 1
current = 1
last = 0

while i < to_calculate:
	next = current + last
	current = last
	last = next
	i += 1

This code calculates the first five numbers in the Fibonacci Sequence. We could increase the number of values we calculate but that would also increase the time it takes for our program to execute. Our program returns:

1

1

2

3

5

This approach bypasses the recursion error because we do not use recursive functions. Instead, we use a while loop to calculate the next number in the list.

Solution #2: Increase Recursion Limit

You can override the default recursion limit Python sets using the setrecursionlimit() method:

import sys
sys.setrecursionlimit(5000)

This code sets the maximum recursion depth to 5,000. You should be careful when you use this method because it may cause a stack overflow depending on the resources available to the Python interpreter.

In general, it is best to rewrite a function to use an iterative approach instead of increasing the recursion limit.

Venus profile photo

«Career Karma entered my life when I needed it most and quickly helped me match with a bootcamp. Two months after graduating, I found my dream job that aligned with my values and goals in life!»

Venus, Software Engineer at Rockbot

Conclusion

The “maximum recursion depth exceeded in comparison” error is raised when you try to execute a function that exceeds Python’s built in recursion limit. You can fix this error by rewriting your program to use an iterative approach or by increasing the recursion limit in Python.

Now you have the knowledge you need to fix this error like a pro!

I can’t reproduce the error with the initial script, however I have a slightly different (minimal) script causing the same error

import pandas

def process(dfa: pandas.DataFrame, dfb: pandas.DataFrame) -> pandas.DataFrame:
   return pandas.merge(dfa, dfb)
$ pylint --disable=all --enable=F,E mwe.py
[...]
RecursionError: maximum recursion depth exceeded

Full Traceback

Traceback (most recent call last):
  File "/tmp/tmp/venv/bin/pylint", line 8, in <module>
    sys.exit(run_pylint())
  File "/tmp/tmp/venv/lib/python3.8/site-packages/pylint/__init__.py", line 22, in run_pylint
    PylintRun(sys.argv[1:])
  File "/tmp/tmp/venv/lib/python3.8/site-packages/pylint/lint/run.py", line 349, in __init__
    linter.check(args)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 862, in check
    self._check_files(
  File "/tmp/tmp/venv/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 896, in _check_files
    self._check_file(get_ast, check_astroid_module, name, filepath, modname)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 922, in _check_file
    check_astroid_module(ast_node)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 1054, in check_astroid_module
    retval = self._check_astroid_module(
  File "/tmp/tmp/venv/lib/python3.8/site-packages/pylint/lint/pylinter.py", line 1099, in _check_astroid_module
    walker.walk(ast_node)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/pylint/utils/ast_walker.py", line 75, in walk
    self.walk(child)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/pylint/utils/ast_walker.py", line 75, in walk
    self.walk(child)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/pylint/utils/ast_walker.py", line 75, in walk
    self.walk(child)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/pylint/utils/ast_walker.py", line 72, in walk
    callback(astroid)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/pylint/checkers/strings.py", line 412, in visit_call
    func = utils.safe_infer(node.func)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/pylint/checkers/utils.py", line 1143, in safe_infer
    value = next(infer_gen)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 319, in infer_attribute
    yield from owner.igetattr(self.attrname, context)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 93, in wrapped
    generator = _func(node, context, **kwargs)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 273, in infer_import_from
    module = self.do_import_module()
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/mixins.py", line 99, in do_import_module
    return mymodule.import_module(
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 642, in import_module
    return MANAGER.ast_from_module_name(absmodname)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/manager.py", line 189, in ast_from_module_name
    return self.ast_from_file(found_spec.location, modname, fallback=False)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/manager.py", line 98, in ast_from_file
    return AstroidBuilder(self).file_build(filepath, modname)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/builder.py", line 138, in file_build
    return self._post_build(module, encoding)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/builder.py", line 158, in _post_build
    self.delayed_assattr(delayed)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/builder.py", line 226, in delayed_assattr
    for inferred in node.expr.infer():
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 227, in infer_call
    for callee in self.func.infer(context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 293, in infer_attribute
    for owner in self.expr.infer(context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 252, in infer_import
    yield self.do_import_module(self.real_name(name))
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/mixins.py", line 99, in do_import_module
    return mymodule.import_module(
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 642, in import_module
    return MANAGER.ast_from_module_name(absmodname)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/manager.py", line 189, in ast_from_module_name
    return self.ast_from_file(found_spec.location, modname, fallback=False)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/manager.py", line 98, in ast_from_file
    return AstroidBuilder(self).file_build(filepath, modname)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/builder.py", line 138, in file_build
    return self._post_build(module, encoding)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/builder.py", line 158, in _post_build
    self.delayed_assattr(delayed)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/builder.py", line 226, in delayed_assattr
    for inferred in node.expr.infer():
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 367, in infer_subscript
    for value in self.value.infer(context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 227, in infer_call
    for callee in self.func.infer(context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 293, in infer_attribute
    for owner in self.expr.infer(context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 233, in infer_call
    yield from callee.infer_call_result(caller=self, context=callcontext)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 1722, in infer_call_result
    yield from returnnode.value.infer(context)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 233, in infer_call
    yield from callee.infer_call_result(caller=self, context=callcontext)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 1722, in infer_call_result
    yield from returnnode.value.infer(context)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 93, in wrapped
    generator = _func(node, context, **kwargs)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 850, in infer_assign
    stmts = list(self.assigned_stmts(context=context))
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 233, in infer_call
    yield from callee.infer_call_result(caller=self, context=callcontext)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 1722, in infer_call_result
    yield from returnnode.value.infer(context)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 227, in infer_call
    for callee in self.func.infer(context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 293, in infer_attribute
    for owner in self.expr.infer(context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 93, in wrapped
    generator = _func(node, context, **kwargs)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 850, in infer_assign
    stmts = list(self.assigned_stmts(context=context))
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 233, in infer_call
    yield from callee.infer_call_result(caller=self, context=callcontext)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 1722, in infer_call_result
    yield from returnnode.value.infer(context)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 227, in infer_call
    for callee in self.func.infer(context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 293, in infer_attribute
    for owner in self.expr.infer(context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 93, in wrapped
    generator = _func(node, context, **kwargs)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 273, in infer_import_from
    module = self.do_import_module()
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/mixins.py", line 99, in do_import_module
    return mymodule.import_module(
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 642, in import_module
    return MANAGER.ast_from_module_name(absmodname)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/manager.py", line 189, in ast_from_module_name
    return self.ast_from_file(found_spec.location, modname, fallback=False)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/manager.py", line 98, in ast_from_file
    return AstroidBuilder(self).file_build(filepath, modname)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/builder.py", line 138, in file_build
    return self._post_build(module, encoding)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/builder.py", line 158, in _post_build
    self.delayed_assattr(delayed)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/builder.py", line 226, in delayed_assattr
    for inferred in node.expr.infer():
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 227, in infer_call
    for callee in self.func.infer(context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 293, in infer_attribute
    for owner in self.expr.infer(context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 93, in wrapped
    generator = _func(node, context, **kwargs)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 850, in infer_assign
    stmts = list(self.assigned_stmts(context=context))
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/protocols.py", line 331, in _arguments_infer_argname
    is_metaclass = isinstance(cls, nodes.ClassDef) and cls.type == "metaclass"
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 1830, in _class_type
    if _is_metaclass(klass):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 1799, in _is_metaclass
    for baseobj in base.infer():
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 93, in wrapped
    generator = _func(node, context, **kwargs)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 273, in infer_import_from
    module = self.do_import_module()
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/mixins.py", line 99, in do_import_module
    return mymodule.import_module(
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 642, in import_module
    return MANAGER.ast_from_module_name(absmodname)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/manager.py", line 189, in ast_from_module_name
    return self.ast_from_file(found_spec.location, modname, fallback=False)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/manager.py", line 98, in ast_from_file
    return AstroidBuilder(self).file_build(filepath, modname)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/builder.py", line 138, in file_build
    return self._post_build(module, encoding)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/builder.py", line 158, in _post_build
    self.delayed_assattr(delayed)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/builder.py", line 226, in delayed_assattr
    for inferred in node.expr.infer():
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 227, in infer_call
    for callee in self.func.infer(context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 93, in wrapped
    generator = _func(node, context, **kwargs)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 273, in infer_import_from
    module = self.do_import_module()
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/mixins.py", line 99, in do_import_module
    return mymodule.import_module(
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 642, in import_module
    return MANAGER.ast_from_module_name(absmodname)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/manager.py", line 189, in ast_from_module_name
    return self.ast_from_file(found_spec.location, modname, fallback=False)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/manager.py", line 98, in ast_from_file
    return AstroidBuilder(self).file_build(filepath, modname)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/builder.py", line 138, in file_build
    return self._post_build(module, encoding)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/builder.py", line 158, in _post_build
    self.delayed_assattr(delayed)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/builder.py", line 226, in delayed_assattr
    for inferred in node.expr.infer():
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 227, in infer_call
    for callee in self.func.infer(context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 93, in wrapped
    generator = _func(node, context, **kwargs)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 273, in infer_import_from
    module = self.do_import_module()
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/mixins.py", line 99, in do_import_module
    return mymodule.import_module(
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 642, in import_module
    return MANAGER.ast_from_module_name(absmodname)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/manager.py", line 189, in ast_from_module_name
    return self.ast_from_file(found_spec.location, modname, fallback=False)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/manager.py", line 98, in ast_from_file
    return AstroidBuilder(self).file_build(filepath, modname)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/builder.py", line 138, in file_build
    return self._post_build(module, encoding)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/builder.py", line 158, in _post_build
    self.delayed_assattr(delayed)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/builder.py", line 226, in delayed_assattr
    for inferred in node.expr.infer():
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 227, in infer_call
    for callee in self.func.infer(context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 293, in infer_attribute
    for owner in self.expr.infer(context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 293, in infer_attribute
    for owner in self.expr.infer(context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 233, in infer_call
    yield from callee.infer_call_result(caller=self, context=callcontext)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 1722, in infer_call_result
    yield from returnnode.value.infer(context)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 227, in infer_call
    for callee in self.func.infer(context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 93, in wrapped
    generator = _func(node, context, **kwargs)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 273, in infer_import_from
    module = self.do_import_module()
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/mixins.py", line 99, in do_import_module
    return mymodule.import_module(
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 642, in import_module
    return MANAGER.ast_from_module_name(absmodname)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/manager.py", line 189, in ast_from_module_name
    return self.ast_from_file(found_spec.location, modname, fallback=False)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/manager.py", line 98, in ast_from_file
    return AstroidBuilder(self).file_build(filepath, modname)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/builder.py", line 138, in file_build
    return self._post_build(module, encoding)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/builder.py", line 158, in _post_build
    self.delayed_assattr(delayed)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/builder.py", line 226, in delayed_assattr
    for inferred in node.expr.infer():
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 233, in infer_call
    yield from callee.infer_call_result(caller=self, context=callcontext)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 1722, in infer_call_result
    yield from returnnode.value.infer(context)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 227, in infer_call
    for callee in self.func.infer(context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 293, in infer_attribute
    for owner in self.expr.infer(context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 227, in infer_call
    for callee in self.func.infer(context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 293, in infer_attribute
    for owner in self.expr.infer(context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 233, in infer_call
    yield from callee.infer_call_result(caller=self, context=callcontext)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 1722, in infer_call_result
    yield from returnnode.value.infer(context)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 233, in infer_call
    yield from callee.infer_call_result(caller=self, context=callcontext)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 1722, in infer_call_result
    yield from returnnode.value.infer(context)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 479, in _filter_operation_errors
    for result in infer_callable(self, context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 798, in _infer_augassign
    for lhs, rhs in itertools.product(lhs_iter, rhs_iter):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 233, in infer_call
    yield from callee.infer_call_result(caller=self, context=callcontext)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 1722, in infer_call_result
    yield from returnnode.value.infer(context)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 233, in infer_call
    yield from callee.infer_call_result(caller=self, context=callcontext)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 1722, in infer_call_result
    yield from returnnode.value.infer(context)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 227, in infer_call
    for callee in self.func.infer(context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 93, in wrapped
    generator = _func(node, context, **kwargs)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 273, in infer_import_from
    module = self.do_import_module()
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/mixins.py", line 99, in do_import_module
    return mymodule.import_module(
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 642, in import_module
    return MANAGER.ast_from_module_name(absmodname)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/manager.py", line 189, in ast_from_module_name
    return self.ast_from_file(found_spec.location, modname, fallback=False)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/manager.py", line 98, in ast_from_file
    return AstroidBuilder(self).file_build(filepath, modname)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/builder.py", line 138, in file_build
    return self._post_build(module, encoding)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/builder.py", line 158, in _post_build
    self.delayed_assattr(delayed)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/builder.py", line 226, in delayed_assattr
    for inferred in node.expr.infer():
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 233, in infer_call
    yield from callee.infer_call_result(caller=self, context=callcontext)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 380, in <genexpr>
    return (Instance(x) if x is not util.Uninferable else x for x in infer)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 93, in wrapped
    generator = _func(node, context, **kwargs)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 850, in infer_assign
    stmts = list(self.assigned_stmts(context=context))
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/protocols.py", line 331, in _arguments_infer_argname
    is_metaclass = isinstance(cls, nodes.ClassDef) and cls.type == "metaclass"
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 1830, in _class_type
    if _is_metaclass(klass):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 1799, in _is_metaclass
    for baseobj in base.infer():
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 93, in wrapped
    generator = _func(node, context, **kwargs)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 273, in infer_import_from
    module = self.do_import_module()
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/mixins.py", line 99, in do_import_module
    return mymodule.import_module(
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 642, in import_module
    return MANAGER.ast_from_module_name(absmodname)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/manager.py", line 189, in ast_from_module_name
    return self.ast_from_file(found_spec.location, modname, fallback=False)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/manager.py", line 98, in ast_from_file
    return AstroidBuilder(self).file_build(filepath, modname)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/builder.py", line 138, in file_build
    return self._post_build(module, encoding)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/builder.py", line 158, in _post_build
    self.delayed_assattr(delayed)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/builder.py", line 226, in delayed_assattr
    for inferred in node.expr.infer():
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 233, in infer_call
    yield from callee.infer_call_result(caller=self, context=callcontext)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 1722, in infer_call_result
    yield from returnnode.value.infer(context)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 227, in infer_call
    for callee in self.func.infer(context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 293, in infer_attribute
    for owner in self.expr.infer(context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 233, in infer_call
    yield from callee.infer_call_result(caller=self, context=callcontext)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 1722, in infer_call_result
    yield from returnnode.value.infer(context)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 227, in infer_call
    for callee in self.func.infer(context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 293, in infer_attribute
    for owner in self.expr.infer(context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 93, in wrapped
    generator = _func(node, context, **kwargs)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 273, in infer_import_from
    module = self.do_import_module()
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/mixins.py", line 99, in do_import_module
    return mymodule.import_module(
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 642, in import_module
    return MANAGER.ast_from_module_name(absmodname)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/manager.py", line 189, in ast_from_module_name
    return self.ast_from_file(found_spec.location, modname, fallback=False)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/manager.py", line 98, in ast_from_file
    return AstroidBuilder(self).file_build(filepath, modname)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/builder.py", line 138, in file_build
    return self._post_build(module, encoding)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/builder.py", line 158, in _post_build
    self.delayed_assattr(delayed)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/builder.py", line 226, in delayed_assattr
    for inferred in node.expr.infer():
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 142, in raise_if_nothing_inferred
    yield from generator
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 233, in infer_call
    yield from callee.infer_call_result(caller=self, context=callcontext)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 1722, in infer_call_result
    yield from returnnode.value.infer(context)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 227, in infer_call
    for callee in self.func.infer(context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 293, in infer_attribute
    for owner in self.expr.infer(context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 233, in infer_call
    yield from callee.infer_call_result(caller=self, context=callcontext)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/scoped_nodes.py", line 1722, in infer_call_result
    yield from returnnode.value.infer(context)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 227, in infer_call
    for callee in self.func.infer(context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 293, in infer_attribute
    for owner in self.expr.infer(context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 96, in wrapped
    res = next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/bases.py", line 136, in _infer_stmts
    for inferred in stmt.infer(context=context):
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/util.py", line 160, in limit_inference
    yield from islice(iterator, size)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 113, in cache_generator
    for result in generator:
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 132, in raise_if_nothing_inferred
    yield next(generator)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/decorators.py", line 93, in wrapped
    generator = _func(node, context, **kwargs)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/inference.py", line 850, in infer_assign
    stmts = list(self.assigned_stmts(context=context))
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/protocols.py", line 309, in assend_assigned_stmts
    return self.parent.assigned_stmts(node=self, context=context)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/protocols.py", line 375, in arguments_assigned_stmts
    context = contextmod.copy_context(context)
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 155, in copy_context
    return context.clone()
  File "/tmp/tmp/venv/lib/python3.8/site-packages/astroid/context.py", line 102, in clone
    clone = InferenceContext(self.path, inferred=self.inferred)
RecursionError: maximum recursion depth exceeded

The relevant versions

$ pylint --version
pylint 2.6.0
astroid 2.4.2
Python 3.8.2 (default, Jul 16 2020, 14:00:26) 
[GCC 9.3.0]

$ pip freeze | grep pandas
pandas==1.1.2

When downgrading pandas to 1.0.5 (as suggested by @Choc13), the error does not occur anymore

$ pip install pandas~=1.0.0
[...]

$ pip freeze | grep pandas
pandas==1.0.5

$ pylint --disable=all --enable=F,E mwe.py

--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 0.00/10, +10.00)

Problem

In Python, in order to prevent stack overflow (using too much memory to cause), the recursion we use has a limit on the number of layers. Once we use the recursion depth exceeding the preset limit, the following error will be triggered:

RecursionError: maximum recursion depth exceeded

We have two solutions to solve this problem:

  1. Rewrite recursive algorithm (optimization)
  2. Set the recursion depth limit (although not recommended, this method is faster, you can choose after measuring your own equipment)

Set the recursion depth limit

We can use the following code to confirm the current recursion depth:

import sys
print(sys.getrecursionlimit())

Output:

1000

Basically, the default depth of Python is 1000, and we can adjust this depth through programs. Assuming that we need to set the depth to 2000, then we write at the beginning of the program:

sys.setrecursionlimit(2000)

As a result, the program that would have reported an error should be able to execute normally.


References

  • https://stackoverflow.com/questions/3323001/what-is-the-maximum-recursion-depth-in-python-and-how-to-increase-it

Read More

  • [Solved][Python] How to Remove with borders when drawing in matplotlib package
  • [Solved][Python] AttributeError: module ‘win32ctypes.pywin32.win32api’ has no attribute ‘error’
  • [Solved][Python] ValueError: unsupported image mode ‘LA’
  • [Solved][Python] ModuleNotFoundError: No module named ‘cStringIO’

Related

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Ошибка maximum call stack size exceeded
  • Ошибка max payne requires a directx 8 compatible display adapter