diff options
author | Lewis Haley <lewis.haley@youview.com> | 2018-07-26 11:43:28 +0100 |
---|---|---|
committer | Lewis Haley <lewis.haley@youview.com> | 2018-08-17 15:33:58 +0100 |
commit | 87029392fd73521a3d25e3ceba363c19d93a3c7a (patch) | |
tree | 43e06db854bf4d5b306d0f0dbb912d5b1ae10580 /sphinx/ext/autodoc/directive.py | |
parent | 9cddc344db5103638eff233573275e1c38c6d8ae (diff) | |
download | sphinx-git-87029392fd73521a3d25e3ceba363c19d93a3c7a.tar.gz |
test_autodoc: fix mutable function default argument in do_autodoc
Setting mutable types as default arguments is bad practice because the
value is only initialised once. This means that defaults arguments of
lists and dictionaries which are modified during code execution *stay*
modified between calls.
In this case, the `options` dictionary accumulated options as more and
more test cases were executed. Without this change, the tests added in
the next commit do not pass.
See: https://stackoverflow.com/questions/1132941/least-astonishment-and-the-mutable-default-argument
Diffstat (limited to 'sphinx/ext/autodoc/directive.py')
0 files changed, 0 insertions, 0 deletions