[New-bugs-announce] [issue33035] Some examples in documentation section 4.7.2 are incorrect

Stephen Wille Padnos report at bugs.python.org
Fri Mar 9 10:27:32 EST 2018


New submission from Stephen Wille Padnos <steve at thothsystems.com>:

Section 4.7.2 of the documentation, "Keyword Arguments", has several examples of valid calls to the sample function parrot.

The function definition is:
def parrot(voltage, state='a stiff', action='voom', type='Norwegian Blue'):

The last two calls in the valid samples are actually not valid, since they are missing the required "voltage" parameter.
parrot('a million', 'bereft of life', 'jump')         # 3 positional arguments
parrot('a thousand', state='pushing up the daisies')  # 1 positional, 1 keyword

They should be changed to include a value for voltage, along with a change to the comment:
parrot(1000, 'a million', 'bereft of life', 'jump')         # 4 positional arguments
parrot(1000, 'a thousand', state='pushing up the daisies')  # 2 positional, 1 keyword

This issue is present in all currently available versions of the documentation: 2.7; 3.5; 3.6.4; pre (3.7); and dev (3.8).

----------
assignee: docs at python
components: Documentation
messages: 313485
nosy: docs at python, stephenwp
priority: normal
severity: normal
status: open
title: Some examples in documentation section 4.7.2 are incorrect
type: enhancement
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8

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


More information about the New-bugs-announce mailing list