-
-
Notifications
You must be signed in to change notification settings - Fork 34.1k
Open
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir
Description
Documentation
The docs for bisect.bisect use a kind of funky pattern with a list as a default argument:
https://docs.python.org/3/library/bisect.html#examples
Using a list as a default argument is a really common pattern beginners think will be helpful but usually isn't due to the way default arguments are bound to the class object instead of instances. It's also distracting for more advanced readers who are trained to spot this pattern in code reviews.
IMO this example would be clearer if grade accepted no arguments besides score and the defaults were inlined.
Linked PRs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir
Projects
Status
Todo