From d982c50727f1bf127397517bf3affe3951e81958 Mon Sep 17 00:00:00 2001 From: Paul McCarthy <pauldmccarthy@gmail.com> Date: Sun, 18 Feb 2018 14:21:44 +0000 Subject: [PATCH] Mention lru_cache in memoize example. Link to python packaging docs in structuring talk. --- advanced_topics/06_decorators.ipynb | 5 +++++ advanced_topics/06_decorators.md | 5 +++++ talks/structuring/structuring.ipynb | 4 ++++ talks/structuring/structuring.md | 4 ++++ 4 files changed, 18 insertions(+) diff --git a/advanced_topics/06_decorators.ipynb b/advanced_topics/06_decorators.ipynb index 8601e8b..706a427 100644 --- a/advanced_topics/06_decorators.ipynb +++ b/advanced_topics/06_decorators.ipynb @@ -644,6 +644,11 @@ "cell_type": "markdown", "metadata": {}, "source": [ + "> Note that in Python 3.2 and newer you can use the\n", + "> [`functools.lru_cache`](https://docs.python.org/3/library/functools.html#functools.lru_cache)\n", + "> to memoize your functions.\n", + "\n", + "\n", "<a class=\"anchor\" id=\"decorator-classes\"></a>\n", "## Decorator classes\n", "\n", diff --git a/advanced_topics/06_decorators.md b/advanced_topics/06_decorators.md index 86b0633..1d0292f 100644 --- a/advanced_topics/06_decorators.md +++ b/advanced_topics/06_decorators.md @@ -493,6 +493,11 @@ expensiveFunc(1) ``` +> Note that in Python 3.2 and newer you can use the +> [`functools.lru_cache`](https://docs.python.org/3/library/functools.html#functools.lru_cache) +> to memoize your functions. + + <a class="anchor" id="decorator-classes"></a> ## Decorator classes diff --git a/talks/structuring/structuring.ipynb b/talks/structuring/structuring.ipynb index 583cf16..db36137 100644 --- a/talks/structuring/structuring.ipynb +++ b/talks/structuring/structuring.ipynb @@ -31,6 +31,10 @@ "* [Appendix: Cookiecutter](#appendix-cookiecutter)\n", "\n", "\n", + "Official documentation:\n", + "https://packaging.python.org/tutorials/distributing-packages/\n", + "\n", + "\n", "<a class=\"anchor\" id=\"recommended-project-structure\"></a>\n", "## Recommended project structure\n", "\n", diff --git a/talks/structuring/structuring.md b/talks/structuring/structuring.md index efbac95..f47c327 100644 --- a/talks/structuring/structuring.md +++ b/talks/structuring/structuring.md @@ -25,6 +25,10 @@ directory. * [Appendix: Cookiecutter](#appendix-cookiecutter) +Official documentation: +https://packaging.python.org/tutorials/distributing-packages/ + + <a class="anchor" id="recommended-project-structure"></a> ## Recommended project structure -- GitLab