Title: Bisect docs define a function that uses a list as a default argument · Issue #145269 · python/cpython · GitHub
Open Graph Title: Bisect docs define a function that uses a list as a default argument · Issue #145269 · python/cpython
X Title: Bisect docs define a function that uses a list as a default argument · Issue #145269 · python/cpython
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 ...
Open Graph 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 ...
X 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 ...
Opengraph URL: https://github.com/python/cpython/issues/145269
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bisect docs define a function that uses a list as a default argument","articleBody":"### Documentation\n\nThe docs for `bisect.bisect` use a kind of funky pattern with a list as a default argument:\n\nhttps://docs.python.org/3/library/bisect.html#examples\n\n\u003cimg width=\"822\" height=\"275\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/8dea706c-b2e8-4583-aea7-b69a905b05d9\" /\u003e\n\nUsing 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.\n\nIMO this example would be clearer if `grade` accepted no arguments besides `score` and the defaults were inlined.\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-145270\n* gh-145367\n* gh-145368\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/ngoldbaum","@type":"Person","name":"ngoldbaum"},"datePublished":"2026-02-26T19:45:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/145269/cpython/issues/145269"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f11e2ccd-40c1-4b99-23dd-90cf693a21d1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AEB6:4950B:647EA19:8CE7732:6A5030E0 |
| html-safe-nonce | 62ae5dd97c93107f35f08367b7659621297994365c3d5b82bb6cc7136f8244c5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRUI2OjQ5NTBCOjY0N0VBMTk6OENFNzczMjo2QTUwMzBFMCIsInZpc2l0b3JfaWQiOiI3MzA5NTIzNTM5MTE1MTI3MDA4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 764ff0a3434f1d6ac29d9554b02e21efbf79525a030d7ee0cf736c7713311422 |
| hovercard-subject-tag | issue:3997426498 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/145269/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fc17b7459c359a181f7f7dc0b08164f7fa8bfcb3cf00deb1cf7e9b2cc9eec7ef/python/cpython/issues/145269 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fc17b7459c359a181f7f7dc0b08164f7fa8bfcb3cf00deb1cf7e9b2cc9eec7ef/python/cpython/issues/145269 |
| og:image:alt | 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 ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ngoldbaum |
| hostname | github.com |
| expected-hostname | github.com |
| None | d6dc8294eb500fa36bbc57472d61fe87c522f9c3c1d64f70f4926f66a66a7efb |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d90666eaf032b7eb8975a378efe38e37f4ebb96c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width