Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added memoize/py.typed
Empty file.
17 changes: 17 additions & 0 deletions memoize/wrapper.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from typing import Callable, TypeVar, overload

from memoize.configuration import CacheConfiguration
from memoize.invalidation import InvalidationSupport

FN = TypeVar('FN', bound=Callable)


@overload
def memoize(*, configuration: CacheConfiguration = None,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

configuration and invalidation are optional and should be marked accordingly (Optional from typing).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense.
@kwarunek can you take a look again?

invalidation: InvalidationSupport = None) -> Callable[[FN], FN]: ...


@overload
def memoize(method: FN,
configuration: CacheConfiguration = None,
invalidation: InvalidationSupport = None) -> FN: ...
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def prepare_description():
url='https://github.com/DreamLab/memoize',
maintainer='DreamLab',
packages=['memoize'],
package_data={'memoize': ['py.typed']},
test_suite='tests',
license='Apache License 2.0',
description=('Caching library for asynchronous Python applications (both based on asyncio and Tornado) '
Expand Down