Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6608529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:37:10+00:00 2026-05-25T19:37:10+00:00

I have a script I wrote in python and it works fine but I

  • 0

I have a script I wrote in python and it works fine but I was curious to see if I could speed it up. It basically is recursive script.

If I run it within normal python 2.7, it takes about 30 seconds. When I run the same thing using pypy than I get the following error:

RuntimeError: maximum recursion depth exceeded

I’m not sure what pypy is doing differently because I’m not modifying the script.

Can anyone help me understand what is going on?

Update:
ok I figured it out. Increasing the limit helped but I think I was running the wrong file. I found a file under the bin directory called py.py and was using that. I’m not sure what the file does but its slower than normal python. I had to search and find ‘pypy-c’ seems to work now.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:37:11+00:00Added an answer on May 25, 2026 at 7:37 pm

    As you suggest in your update your problem was that you were using py.py (which is for running PyPy’s interpreter on top of CPython). PyPy has a higher recursion limit than CPython normally. You can use sys.setrecursionlimit() to increase the recursion limit, sys.getrecursionlimit() does not provide the actual recursion limit.

    PyPy 1.6.0:
    
    >>>> sys.getrecursionlimit()
    100
    
    >>>> def infinite(level=0):
    ....     print level
    ....     return infinite(level+1)
    .... 
    
    >>> infinite()
    <snip>
    1010
    Traceback (most recent call last):
      File "<console>", line 2, in infinite
    RuntimeError: maximum recursion depth exceeded
    
    >>> sys.setrecursionlimit(sys.maxint)
    
    >>> infinite()
    <snip>
    9769
    zsh: segmentation fault  pypy
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have python script that works fine but only when run as stand-alone, while
I have written following script in python which works fine: from sys import argv
I have a little script I wrote in python and it actually works on
I have a Python script I recently wrote that I call using the command
i have wrote a script to produce an array of data but now want
I have created a Python script that I want to run daily via a
I have a script that I wrote in python for testing out the sorting
I have the following python script and it works beautifully. import urllib2 url =
I am not too familiar with python and have to write a script to
I have a Perl script I wrote for my own personal use that fetches

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.