RunestoneInteractive / fopp

Foundations of Python Programming
https://runestone.academy/runestone/static/fopp/index.html
37 stars 120 forks source link

misconception #231

Closed irunestone closed 4 years ago

irunestone commented 5 years ago

Error reported in course fopp on page Optionalreverseparameter by user -dead-inside- bro.mad2016@yandex.ru quote: "Note

This is a situation where it is convenient to use the keyword mechanism for providing optional parameters. It is possible to provide the value True for the reverse parameter without naming that parameter, but then we would have to provide a value for the second parameter as well, rather than allowing the default parameter value to be used. We would have had to write sorted(L2, None, True). That’s a lot harder for humans to read and understand."

This is not true. Quote from official doc. "Has two optional arguments which must be specified as keyword arguments."

bnmnetp commented 5 years ago

Thanks, this is a holdover from Python 2.7.

The optional arguments cmp, key, and reverse have the same meaning as those for the list.sort() method

We'll need to update the text.