[docs] [issue33836] [Good first-time issue] Recommend keyword-only param for memoization in FAQ

Zachary Ware report at bugs.python.org
Mon Jun 11 11:59:35 EDT 2018


New submission from Zachary Ware <zachary.ware at gmail.com>:

In https://docs.python.org/3/faq/programming.html#why-are-default-values-shared-between-objects there is an example showing memoization using `def expensive(arg1, arg2, _cache={}):`.  We should change the signature in that example to make `_cache` a keyword-only parameter and possibly adjust the comment to note that that's been done to prevent accidental calls with three positional arguments.



Note to existing contributors: if this wouldn't be within your first couple of patches, please leave this for a new contributor to find.  Thanks!

----------
assignee: docs at python
components: Documentation
keywords: easy
messages: 319310
nosy: docs at python, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: [Good first-time issue] Recommend keyword-only param for memoization in FAQ
versions: Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33836>
_______________________________________


More information about the docs mailing list