Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move all public methods to the api namespace #19

Merged
merged 11 commits into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from 10 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
1 change: 1 addition & 0 deletions CHANGES/19.breaking.rst
webknjaz marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Moved :func:`propcache.api.under_cached_property` and :func:`propcache.api.cached_property` to ``propcache.api`` -- by :user:`bdraco`.
6 changes: 4 additions & 2 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Reference
=========

.. module:: propcache
.. module:: propcache.api



Expand All @@ -15,7 +15,7 @@ cached_property

This decorator functions exactly the same as the standard library
:func:`cached_property` decorator, but it's available in the
:mod:`propcache` module along with an accelerated Cython version.
:mod:`propcache.api` module along with an accelerated Cython version.

As with the standard library version, the cached value is stored in
the instance's ``__dict__`` dictionary. To clear a cached value, you
Expand All @@ -34,6 +34,8 @@ under_cached_property

Example::

from propcache.api import under_cached_property

class MyClass:

def __init__(self, data: List[float]):
Expand Down
10 changes: 4 additions & 6 deletions propcache/__init__.py
bdraco marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from ._helpers import cached_property, under_cached_property
"""propcache: An accelerated property cache for Python classes."""

__version__ = "0.1.0.dev0"
__version__ = "1.0.0.dev0"

__all__ = (
"cached_property",
"under_cached_property",
)
# Imports have moved to `propcache.api` in 1.0.0+.
bdraco marked this conversation as resolved.
Show resolved Hide resolved
__all__ = ()
8 changes: 8 additions & 0 deletions propcache/api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""Public API of the property caching library."""

from ._helpers import cached_property, under_cached_property
bdraco marked this conversation as resolved.
Show resolved Hide resolved

__all__ = (
"cached_property",
"under_cached_property",
)
Loading