circuitpython-functools 2.0.1__tar.gz → 2.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {circuitpython_functools-2.0.1/circuitpython_functools.egg-info → circuitpython_functools-2.0.2}/PKG-INFO +1 -1
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2/circuitpython_functools.egg-info}/PKG-INFO +1 -1
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/circuitpython_functools.py +5 -5
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/pyproject.toml +1 -1
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/.github/workflows/build.yml +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/.github/workflows/failure-help-text.yml +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/.github/workflows/release_gh.yml +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/.github/workflows/release_pypi.yml +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/.gitignore +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/.pre-commit-config.yaml +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/.readthedocs.yaml +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/CODE_OF_CONDUCT.md +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/LICENSE-MIT +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/LICENSE-PSF +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/LICENSES/CC-BY-4.0.txt +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/LICENSES/MIT.txt +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/LICENSES/PSF-2.0.txt +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/LICENSES/Unlicense.txt +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/README.rst +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/README.rst.license +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/circuitpython_functools.egg-info/SOURCES.txt +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/circuitpython_functools.egg-info/dependency_links.txt +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/circuitpython_functools.egg-info/requires.txt +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/circuitpython_functools.egg-info/top_level.txt +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/docs/_static/favicon.ico +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/docs/_static/favicon.ico.license +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/docs/api.rst +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/docs/api.rst.license +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/docs/conf.py +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/docs/examples.rst +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/docs/examples.rst.license +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/docs/index.rst +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/docs/index.rst.license +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/docs/requirements.txt +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/examples/functools_simpletest.py +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/optional_requirements.txt +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/requirements.txt +0 -0
- {circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/setup.cfg +0 -0
|
@@ -23,7 +23,7 @@ Implementation Notes
|
|
|
23
23
|
import gc
|
|
24
24
|
from collections import OrderedDict
|
|
25
25
|
|
|
26
|
-
__version__ = "2.0.
|
|
26
|
+
__version__ = "2.0.2"
|
|
27
27
|
__repo__ = "https://github.com/tekktrik/CircuitPython_functools.git"
|
|
28
28
|
|
|
29
29
|
_cache_records = {}
|
|
@@ -52,7 +52,7 @@ def _make_key(args, kwargs, kwd_mark=(_ObjectMark(),)):
|
|
|
52
52
|
return hash(key)
|
|
53
53
|
|
|
54
54
|
|
|
55
|
-
class
|
|
55
|
+
class _CachedFunc:
|
|
56
56
|
"""Wrapped unbounded cache function."""
|
|
57
57
|
|
|
58
58
|
def __init__(self, maxsize, user_func):
|
|
@@ -109,7 +109,7 @@ class CachedFunc:
|
|
|
109
109
|
|
|
110
110
|
def cache(user_function):
|
|
111
111
|
"""Create an unbounded cache."""
|
|
112
|
-
return
|
|
112
|
+
return _CachedFunc(-1, user_function)
|
|
113
113
|
|
|
114
114
|
|
|
115
115
|
def lru_cache(*args, **kwargs):
|
|
@@ -121,13 +121,13 @@ def lru_cache(*args, **kwargs):
|
|
|
121
121
|
if len(args) == 1 and isinstance(args[0], int):
|
|
122
122
|
maxsize = args[0]
|
|
123
123
|
elif len(args) == 1 and str(type(args[0]) == "<class 'function'>"):
|
|
124
|
-
return
|
|
124
|
+
return _CachedFunc(128, args[0])
|
|
125
125
|
elif "maxsize" in kwargs:
|
|
126
126
|
maxsize = kwargs["maxsize"]
|
|
127
127
|
else:
|
|
128
128
|
raise SyntaxError("lru_cache syntax incorrect")
|
|
129
129
|
|
|
130
|
-
return partial(
|
|
130
|
+
return partial(_CachedFunc, maxsize)
|
|
131
131
|
|
|
132
132
|
|
|
133
133
|
# Partial ported from the MicroPython library
|
|
@@ -12,7 +12,7 @@ requires = [
|
|
|
12
12
|
[project]
|
|
13
13
|
name = "circuitpython-functools"
|
|
14
14
|
description = "A CircuitPython implementation of CPython's functools library"
|
|
15
|
-
version = "2.0.
|
|
15
|
+
version = "2.0.2"
|
|
16
16
|
readme = "README.rst"
|
|
17
17
|
authors = [
|
|
18
18
|
{name = "Alec Delaney", email = "tekktrik@gmail.com"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/.github/workflows/release_gh.yml
RENAMED
|
File without changes
|
{circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/.github/workflows/release_pypi.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/docs/_static/favicon.ico.license
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{circuitpython_functools-2.0.1 → circuitpython_functools-2.0.2}/examples/functools_simpletest.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|