TheAlgorithms-Python/other
Andrew Grangaard f36ee034f1
[mypy] Annotate other/lru_cache and other/lfu_cache (#5755)
* Adds repr and doctest of current behavior linkedlist in other/lru_cache

* Blocks removal of head or tail of double linked list

* clarifies add() logic for double linked list in other/lru_cache

* expands doctests to compare cache and lru cache

* [mypy] annotates vars for other/lru_cache

* [mypy] Annotates lru_cache decorator for other/lru_cache

* Higher order functions require a verbose Callable annotation

* [mypy] Makes LRU_Cache generic over key and value types for other/lru_cache

+ no reason to force int -> int

* [mypy] makes decorator a classmethod for access to class generic types

* breaks two long lines in doctest for other/lru_cache

* simplifies boundary test remove() for other/lru_cache

* [mypy] Annotates, adds doctests, and makes Generic other/lfu_cache

See also commits to other/lru_cache which guided these

* [mypy] annotates cls var in other/lfu_cache

* cleans up items from code review for lfu_cache and lru_cache

* [mypy] runs mypy on lfu_cache and lru_cache
2021-11-10 23:21:16 +01:00
..
__init__.py Add __init__.py files in all the directories (#2503) 2020-09-28 19:42:36 +02:00
activity_selection.py [mypy] Adds type annotations in other/activity_selection #4052 (#5590) 2021-10-26 12:10:37 +02:00
alternative_list_arrange.py Added alternative_list_arrange method (#4631) 2021-10-31 11:40:32 +01:00
check_strong_password.py Added check_strong_password.py (#4950) 2021-10-20 07:35:41 +02:00
davisb_putnamb_logemannb_loveland.py [mypy] Fixes typing errors in other/dpll (#5759) 2021-11-03 21:32:49 +01:00
dijkstra_bankers_algorithm.py from __future__ import annotations (#2464) 2020-09-23 13:30:13 +02:00
doomsday.py Add doomsday algorithm (#2903) 2020-10-07 20:22:56 +08:00
fischer_yates_shuffle.py [mypy] Fix other/fischer_yates_shuffle.py (#5789) 2021-11-07 11:14:42 +01:00
gauss_easter.py Easter date gauss algorithm (#2010) 2020-05-19 13:44:45 +02:00
graham_scan.py [mypy-fix] Type fixes for graham_scan (#5589) 2021-10-26 11:50:36 +02:00
greedy.py Update greedy.py (#1832) 2020-04-07 01:00:10 +02:00
least_recently_used.py [mypy] fix type annotations for other/least-recently-used.py (#5811) 2021-11-10 20:55:23 +01:00
lfu_cache.py [mypy] Annotate other/lru_cache and other/lfu_cache (#5755) 2021-11-10 23:21:16 +01:00
linear_congruential_generator.py Approve functions used as default arguments (#4699) 2021-08-31 07:56:19 +02:00
lru_cache.py [mypy] Annotate other/lru_cache and other/lfu_cache (#5755) 2021-11-10 23:21:16 +01:00
magicdiamondpattern.py Optimized recursive_bubble_sort (#2410) 2020-09-10 10:31:26 +02:00
nested_brackets.py Set the Python file maximum line length to 88 characters (#2122) 2020-06-16 10:09:19 +02:00
password_generator.py Simplify password_generator() (#4333) 2021-04-22 14:22:54 +05:30
scoring_algorithm.py [mypy] Annotates other/scoring_algorithm (#5621) 2021-10-29 13:21:16 +08:00
sdes.py Tighten up psf/black and flake8 (#2024) 2020-05-22 08:10:11 +02:00
tower_of_hanoi.py psf/black code formatting (#1277) 2019-10-05 10:14:13 +05:00