mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 09:21:13 +08:00
Replace bandit, flake8, isort, and pyupgrade with ruff (#8178)
* Replace bandit, flake8, isort, and pyupgrade with ruff * Comment on ruff rules * updating DIRECTORY.md --------- Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
@ -16,7 +16,7 @@ fib_memoization runtime: 0.0107 ms
|
||||
fib_binet runtime: 0.0174 ms
|
||||
"""
|
||||
|
||||
from functools import lru_cache
|
||||
import functools
|
||||
from math import sqrt
|
||||
from time import time
|
||||
|
||||
@ -110,7 +110,7 @@ def fib_recursive_cached(n: int) -> list[int]:
|
||||
Exception: n is negative
|
||||
"""
|
||||
|
||||
@lru_cache(maxsize=None)
|
||||
@functools.cache
|
||||
def fib_recursive_term(i: int) -> int:
|
||||
"""
|
||||
Calculates the i-th (0-indexed) Fibonacci number using recursion
|
||||
|
Reference in New Issue
Block a user