GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Bisect docs define a function that uses a list as a default argument · Issue #145269 · python/cpython

Bisect docs define a function that uses a list as a default argument #145269

New issue
Copy link
New issue
Copy link
Closed
Closed
Bisect docs define a function that uses a list as a default argument#145269
Copy link
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir

Description

@ngoldbaum
ngoldbaum
opened on Feb 26, 2026
Issue body actions

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

Image

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

  • gh-145269: simplify bisect.bisect doc example #145270
  • [3.14] gh-145269: simplify bisect.bisect doc example (GH-145270) #145367
  • [3.13] gh-145269: simplify bisect.bisect doc example (GH-145270) #145368
Reacted by M. Kocher

Activity

  1. ngoldbaum
    added
    docsDocumentation in the Doc dirDocumentation in the Doc dir
    on Feb 26, 2026
  2. github-project-automation
    added this to docs issueson Feb 26, 2026
  3. github-project-automation
    moved this to Todo in docs issueson Feb 26, 2026
  4. ngoldbaum
    added 2 commits that reference this issue on Feb 26, 2026

    pythongh-145269: simplify bisect.bisect doc example

    63cea13

    pythongh-145269: simplify bisect.bisect doc example

    541e566
  5. itamaro
    added a commit that references this issue on Feb 28, 2026

    gh-145269: simplify bisect.bisect doc example (#145270)

    fdb4b35
  6. brijkapadia
    added a commit that references this issue on Feb 28, 2026

    pythongh-145269: simplify bisect.bisect doc example (python#145270)

    b17b37c
  7. miss-islington
    added 2 commits that reference this issue on Feb 28, 2026

    pythongh-145269: simplify bisect.bisect doc example (pythonGH-145270)

    61fe48a

    pythongh-145269: simplify bisect.bisect doc example (pythonGH-145270)

    f08929f
  8. picnixz
    added 2 commits that reference this issue on Feb 28, 2026

    [3.14] gh-145269: simplify bisect.bisect doc example (GH-145270) (#14…

    4152bbb

    [3.13] gh-145269: simplify bisect.bisect doc example (GH-145270) (#14…

    0e57600
  9. picnixz
    closed this as completedon Feb 28, 2026
  10. ljfp
    added a commit that references this issue on Apr 25, 2026

    pythongh-145269: simplify bisect.bisect doc example (python#145270)

    3f2be79
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dirDocumentation in the Doc dir

    Projects

    • docs issues
      Status
      Todo
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.