Title: Generator expression behavior changed in 3.13.4 - it does not throw exception anymore · Issue #135171 · python/cpython · GitHub
Open Graph Title: Generator expression behavior changed in 3.13.4 - it does not throw exception anymore · Issue #135171 · python/cpython
X Title: Generator expression behavior changed in 3.13.4 - it does not throw exception anymore · Issue #135171 · python/cpython
Description: Bug report Bug description: In 3.13.3 and before >>> bool(_ for item in False) Traceback (most recent call last): File "
Open Graph Description: Bug report Bug description: In 3.13.3 and before >>> bool(_ for item in False) Traceback (most recent call last): File "
X Description: Bug report Bug description: In 3.13.3 and before >>> bool(_ for item in False) Traceback (most recent call last): File "<python-input-14>", line 1, in <module> bool(_...
Opengraph URL: https://github.com/python/cpython/issues/135171
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Generator expression behavior changed in 3.13.4 - it does not throw exception anymore","articleBody":"# Bug report\n\n### Bug description:\n\nIn 3.13.3 and before \n```pycon\n\u003e\u003e\u003e bool(_ for item in False)\nTraceback (most recent call last):\n File \"\u003cpython-input-14\u003e\", line 1, in \u003cmodule\u003e\n bool(_ for item in False)\n ^^^^^\nTypeError: 'bool' object is not iterable\n\u003e\u003e\u003e (_ for item in False)\nTraceback (most recent call last):\n File \"\u003cpython-input-15\u003e\", line 1, in \u003cmodule\u003e\n (_ for item in False)\n ^^^^^\nTypeError: 'bool' object is not iterable\n```\n\nNow in 3.13.4\n```pycon\n\u003e\u003e\u003e bool(_ for item in False)\nTrue\n\u003e\u003e\u003e (_ for item in False)\n\u003cgenerator object \u003cgenexpr\u003e at 0xffffa9c02200\u003e\n```\nThis is very fundamental change. Is it expected?\n\n### CPython versions tested on:\n\n3.13\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-135225\n* gh-135293\n* gh-135351\n* gh-135352\n* gh-135390\n* gh-135403\n* gh-135524\n* gh-135525\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/Roman513","@type":"Person","name":"Roman513"},"datePublished":"2025-06-05T10:12:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":34},"url":"https://github.com/135171/cpython/issues/135171"}
| 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:e0c5369b-396f-af6e-979f-995ee2c4e296 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A5AE:17320D:E1F70:132EB4:696A9AC7 |
| html-safe-nonce | 050793edd38d3050071fe253c553c83bd8d19be78b0b4c5241aead9d6bc9e913 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNUFFOjE3MzIwRDpFMUY3MDoxMzJFQjQ6Njk2QTlBQzciLCJ2aXNpdG9yX2lkIjoiNDQ5NTUzOTU4NjEzNzIzNDExOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 866883373735aea56d454528c3ed7fa8a6d0958ae22fa68175d886003d980857 |
| hovercard-subject-tag | issue:3120633848 |
| 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/135171/issue_layout |
| twitter:image | https://opengraph.githubassets.com/bc0876b2ae90c269c67a0e328554e4e5e6e658e4293d81114a4f02da086c0aaa/python/cpython/issues/135171 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/bc0876b2ae90c269c67a0e328554e4e5e6e658e4293d81114a4f02da086c0aaa/python/cpython/issues/135171 |
| og:image:alt | Bug report Bug description: In 3.13.3 and before >>> bool(_ for item in False) Traceback (most recent call last): File " |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Roman513 |
| hostname | github.com |
| expected-hostname | github.com |
| None | c0d8175e41e0e55b9e984c935b24b808cabab919dd3174aa45dac3ef503ed1af |
| 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 | 99aab454e5ddc8df30805fb76c114c3008a15842 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width