Skip to content

Commit

Permalink
fix: use lru_cache in a compatible way with Python 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
hearot committed Jun 19, 2020
1 parent 5741b02 commit 5b82e39
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
14 changes: 12 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
# Changelog

## v0.1a1
## v0.1a2

### Fixes

- Use `lru_cache` in a compatible way with Python 3.6

### Other changes

- Go from pre-alpha to alpha ([5741b021e100054fd799609a09e20d819f5de43e](https://github.com/hearot/pyrubrum/commit/5741b021e100054fd799609a09e20d819f5de43e))

## v0.1a1 - 2020-06-19

### Documentation

- Add contributing guidelines
- Add contributing guidelines ([5474eb251a807e76ed00b05fb3d49024ca654525](https://github.com/hearot/pyrubrum/commit/5474eb251a807e76ed00b05fb3d49024ca654525))

## v0.1a1.dev7 - 2020-06-19

Expand Down
8 changes: 6 additions & 2 deletions FEATURES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### Documentation
### Fixes

- Add contributing guidelines
- Use `lru_cache` in a compatible way with Python 3.6

### Other changes

- Go from pre-alpha to alpha ([5741b021e100054fd799609a09e20d819f5de43e](https://github.com/hearot/pyrubrum/commit/5741b021e100054fd799609a09e20d819f5de43e))
2 changes: 1 addition & 1 deletion pyrubrum/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
__license__ = "GNU General Public License v3"
__package__ = "pyrubrum"
__url__ = "https://github.com/hearot/pyrubrum"
__version__ = "0.1a1"
__version__ = "0.1a2"

from .database import BaseDatabase # noqa
from .database import DictDatabase # noqa
Expand Down
2 changes: 1 addition & 1 deletion pyrubrum/handlers/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class Handler(BaseHandler):
def __init__(self, nodes: Set[Node]):
self.nodes = nodes

@lru_cache
@lru_cache()
def get_family(
self, menu_id: str
) -> Tuple[Optional[BaseMenu], Optional[Iterable[BaseMenu]]]:
Expand Down
2 changes: 1 addition & 1 deletion pyrubrum/tree/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def get_children_menus(self) -> Iterable[BaseMenu]:
children = tuple(child.menu for child in self.children)
return children if children else None

@lru_cache
@lru_cache()
def get_family(self, menu_id: str, parent: Optional["Node"]) -> Family:
"""Retrieve the menus which are linked to both parent and children of this
instance if this instance matches the provided identifier. Otherwise it
Expand Down

0 comments on commit 5b82e39

Please sign in to comment.