Skip to content

Commit

Permalink
Fix bug in example of custom keygen for classmethod
Browse files Browse the repository at this point in the history
  • Loading branch information
garyd203 authored and Cameron Evans committed Feb 3, 2020
1 parent 1b05caf commit 50ecb02
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ Python 3.6+ decorators including
# You can create a consistent hash key to avoid this.
class Foo:
@classmethod
@memoize(db=True, get_key=lambda cls: (f'{cls.__package__}:{cls.__name__}', a))
@memoize(db=True, get_key=lambda cls, a: (f'{cls.__package__}:{cls.__name__}', a))
def bar(cls, a) -> Any: ...

- Alternative location of 'db' can also be given as pathlib.Path or str.
Expand Down
2 changes: 1 addition & 1 deletion atools/_memoize_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ def bar(cls, a) -> Any: ...
# You can create a consistent hash key to avoid this.
class Foo:
@classmethod
@memoize(db=True, keygen=lambda cls: (f'{cls.__package__}:{cls.__name__}', a))
@memoize(db=True, keygen=lambda cls, a: (f'{cls.__package__}:{cls.__name__}', a))
def bar(cls, a) -> Any: ...
- Alternative location of 'db' can also be given as pathlib.Path or str.
Expand Down

0 comments on commit 50ecb02

Please sign in to comment.