Title: Add itertools.batched() · Issue #98363 · python/cpython · GitHub
Open Graph Title: Add itertools.batched() · Issue #98363 · python/cpython
X Title: Add itertools.batched() · Issue #98363 · python/cpython
Description: This was requested on python-ideas: def batched(iterable, n): "Batch data into lists of length n. The last batch may be shorter." # batched('ABCDEFG', 3) --> ABC DEF G if n < 1: raise ValueError('n must be >= 1') it = iter(iterable) whil...
Open Graph Description: This was requested on python-ideas: def batched(iterable, n): "Batch data into lists of length n. The last batch may be shorter." # batched('ABCDEFG', 3) --> ABC DEF G if n < 1: raise ValueError('n...
X Description: This was requested on python-ideas: def batched(iterable, n): "Batch data into lists of length n. The last batch may be shorter." # batched('ABCDEFG', 3) --> ABC DEF G if n <...
Opengraph URL: https://github.com/python/cpython/issues/98363
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add itertools.batched()","articleBody":"This was requested on python-ideas:\r\n\r\n def batched(iterable, n):\r\n \"Batch data into lists of length n. The last batch may be shorter.\"\r\n # batched('ABCDEFG', 3) --\u003e ABC DEF G\r\n if n \u003c 1:\r\n raise ValueError('n must be \u003e= 1')\r\n it = iter(iterable)\r\n while (batch := list(islice(it, n))):\r\n yield batch\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-100118\n* gh-100138\n* gh-100323\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/rhettinger","@type":"Person","name":"rhettinger"},"datePublished":"2022-10-17T17:46:39.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/98363/cpython/issues/98363"}
| 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:73cbdbfa-1c2a-ab8e-a7c8-eeae65f7a4f0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B64A:1B7E6F:B43543:F9C214:696A7D58 |
| html-safe-nonce | e345ec54ac93535a889f70dc4a2735fe7e3cd64a7cd6393fdc1466d994bcea6a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNjRBOjFCN0U2RjpCNDM1NDM6RjlDMjE0OjY5NkE3RDU4IiwidmlzaXRvcl9pZCI6IjczMTM1OTA1OTM5NTY1MTEwNjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d823ccca2f04defe023721289c4c909b1fd2fec078eff02bc0ac2674c687ad76 |
| hovercard-subject-tag | issue:1411970397 |
| 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/98363/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b3191389dd4aec78502e3e0fa52a277e4c6a467eb7c4bbcd5582b192aae9c6db/python/cpython/issues/98363 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b3191389dd4aec78502e3e0fa52a277e4c6a467eb7c4bbcd5582b192aae9c6db/python/cpython/issues/98363 |
| og:image:alt | This was requested on python-ideas: def batched(iterable, n): "Batch data into lists of length n. The last batch may be shorter." # batched('ABCDEFG', 3) --> ABC DEF G if n < 1: raise ValueError('n... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rhettinger |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5b774e44f85c14a75886edd04ddda4e5a25ddebbb241bcbb590b08a3048730e8 |
| 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 | cc5f4eee261b3601c1e98e217ceaf28508b9567e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width