This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Octopi
Recipients Octopi, terry.reedy
Date 2021-06-10.15:31:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1623339067.02.0.0636537811776.issue44379@roundup.psfhosted.org>
In-reply-to
Content
I accidentally created an infinite recursion. The error referenced pickling but I did not import pickle. 

To reproduce: 
def permute(inputList):
    '''permute(inputList) -> list
    returns list of all permutations of inputList
    CURRENTLY DOESN'T ACTUALLLY WORK PROPERLY'''
    for i in range(len(inputList)-1):
        tempList = inputList[:-i-2]
        tempList.append(inputList[-1])
        for num in inputList[-i-2:-1]:
            tempList.append(num)
        print(tempList)
        permute(tempList)  # runs infinitely (whoops)
    print()

permute([1,2,3,4])

Error thrown: 
Traceback (most recent call last):
  File "C:\Users\Violet\Documents\Python Files\test.py", line 14, in <module>
    permute([1,2,3,4])
  File "C:\Users\Violet\Documents\Python Files\test.py", line 11, in permute
    permute(tempList)  # runs infinitely (whoops)
  File "C:\Users\Violet\Documents\Python Files\test.py", line 11, in permute
    permute(tempList)  # runs infinitely (whoops)
  File "C:\Users\Violet\Documents\Python Files\test.py", line 11, in permute
    permute(tempList)  # runs infinitely (whoops)
  [Previous line repeated 1009 more times]
  File "C:\Users\Violet\Documents\Python Files\test.py", line 10, in permute
    print(tempList)
RecursionError: maximum recursion depth exceeded while pickling an object
History
Date User Action Args
2021-06-10 15:31:07Octopisetrecipients: + Octopi, terry.reedy
2021-06-10 15:31:07Octopisetmessageid: <1623339067.02.0.0636537811776.issue44379@roundup.psfhosted.org>
2021-06-10 15:31:06Octopilinkissue44379 messages
2021-06-10 15:31:06Octopicreate