Fixing and adding notes to the recursive method#5903
Fixing and adding notes to the recursive method#5903one-third-reason wants to merge 2 commits intoTheAlgorithms:masterfrom
Conversation
In the examples of the recursive method output, the function was written as "fib_iterative()" instead of "fib_recursive()" The recursion depth limit thing is added too as a note, and a way to increase the limit is also added Also I'm not a native english speaker so there might be some wrong gramar or something else
maths/fibonacci.py
Outdated
| NOTE: The current recursion depth limit is 1000 (thus n > 1000 won't work) and it will throw an error if it's exceeded to prevent infinite recursion / stack overflow. | ||
| The limit can be changed with the sys module, but setting it too high might evoke a crash: | ||
|
|
||
| import sys | ||
| sys.setrecursionlimit(limit) | ||
|
|
||
| A better solution is to rewrite the code without recursion e.g. with loops, like the iterative method. |
There was a problem hiding this comment.
Two points:
- may not be a good idea to exceed 100 symbols/line.
- won't this chunk raise a
sphinxwarning if we try generating docs?
There was a problem hiding this comment.
I'm sorry but may you explain what a sphinx warning is? Thank you
There was a problem hiding this comment.
Documentation generator (link).
OK, we can skip the 2nd point, just ensure each line is not longer than 100 symbols
There was a problem hiding this comment.
Ah ok I'll try shorten those texts
There was a problem hiding this comment.
Or try moving text to the next line
There was a problem hiding this comment.
Or try moving text to the next line
Good idea 😅
Alright I've changed it, I hope it's fine now
There was a problem hiding this comment.
Now, it does not exceed. I hope docs are only for developers to see, so now it's pretty fine regarding length
andrei-polukhin
left a comment
There was a problem hiding this comment.
Looks pretty fine, at least for a stranger like me :)
|
Need to get a review of someone more knowledgeable, like @Kush1101 |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
In preparation for that denial-of-service attack that is Hacktoberfest, I am closing all pull requests that do not have passing tests. |
In the examples of the recursive method output, the function was written as "fib_iterative()" instead of "fib_recursive()"
The recursion depth limit thing is added too as a note, and a way to increase the limit is also added
Also I'm not a native english speaker so there might be some wrong gramars but I hope there are none
Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}.