mirror of
https://github.com/Brandon-Rozek/website.git
synced 2024-11-09 18:50:34 -05:00
Fixed sentence in tco post.
This commit is contained in:
parent
a8526b57ba
commit
682ee2080a
1 changed files with 2 additions and 2 deletions
|
@ -30,7 +30,7 @@ RecursionError: maximum recursion depth exceeded in comparison
|
||||||
|
|
||||||
## Implementation
|
## Implementation
|
||||||
|
|
||||||
To get around this in Python, we need some sort of [trampoline](https://en.wikipedia.org/wiki/Tail_call#Through_trampolining), or way to exit part the stack and call the recursive function again. This technique is called Tail Call Optimizatoin, and we can do this in Python using exceptions. This code is heavily inspired by Crutcher Dunnavant's [code snippet](https://code.activestate.com/recipes/474088-tail-call-optimization-decorator/) from 2006.
|
To get around this in Python, we need some sort of [trampoline](https://en.wikipedia.org/wiki/Tail_call#Through_trampolining), or way to exit part the stack and call the recursive function again. This technique is often used in Tail Call Optimization, and we can do this in Python using exceptions. This code is heavily inspired by Crutcher Dunnavant's [code snippet](https://code.activestate.com/recipes/474088-tail-call-optimization-decorator/) from 2006.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
"""
|
"""
|
||||||
|
@ -121,4 +121,4 @@ You can install the package via pypi:
|
||||||
pip install tail-recurse
|
pip install tail-recurse
|
||||||
```
|
```
|
||||||
|
|
||||||
It is also available on [Github](https://github.com/Brandon-Rozek/tail-recurse/).
|
It is also available on [Github](https://github.com/Brandon-Rozek/tail-recurse/).
|
||||||
|
|
Loading…
Reference in a new issue