Title: global SyntaxError different in Python REPL vs Bpython · Issue #1011 · bpython/bpython · GitHub
Open Graph Title: global SyntaxError different in Python REPL vs Bpython · Issue #1011 · bpython/bpython
X Title: global SyntaxError different in Python REPL vs Bpython · Issue #1011 · bpython/bpython
Description: Consider the following code (which rightly generates a SyntaxError): >>> counter = 0 >>> def increment(): ... counter += 1 ... global counter In the Python REPL, this generates the following error: SyntaxError: name 'counter' is assigned...
Open Graph Description: Consider the following code (which rightly generates a SyntaxError): >>> counter = 0 >>> def increment(): ... counter += 1 ... global counter In the Python REPL, this generates the following error:...
X Description: Consider the following code (which rightly generates a SyntaxError): >>> counter = 0 >>> def increment(): ... counter += 1 ... global counter In the Python REPL, this generates th...
Opengraph URL: https://github.com/bpython/bpython/issues/1011
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"global SyntaxError different in Python REPL vs Bpython","articleBody":"Consider the following code (which rightly generates a SyntaxError):\r\n\r\n```python\r\n\u003e\u003e\u003e counter = 0\r\n\u003e\u003e\u003e def increment():\r\n... counter += 1\r\n... global counter\r\n```\r\n\r\nIn the Python REPL, this generates the following error:\r\n\r\n```\r\nSyntaxError: name 'counter' is assigned to before global declaration\r\n```\r\n\r\nHowever, in Bpython, the following error occurs:\r\n\r\n```\r\nSyntaxError: incomplete input\r\n```\r\n\r\nThe Bpython error appears to be incorrect to me?","author":{"url":"https://github.com/djaychela","@type":"Person","name":"djaychela"},"datePublished":"2024-02-19T08:57:21.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/1011/bpython/issues/1011"}
| 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:5456dd03-d26f-8239-0795-d176d07c1a09 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E06E:13A71A:73BFF45:9F88BC8:69676FAB |
| html-safe-nonce | a29cd0bbd1ffa70b6c87ce6a9121503a7fddcab13eddee15fb730e0bb2782c39 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMDZFOjEzQTcxQTo3M0JGRjQ1OjlGODhCQzg6Njk2NzZGQUIiLCJ2aXNpdG9yX2lkIjoiMTkzODc2NDkzMzcyMDY2NjAyNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a434afddac42bdbbf4542f030241bfb7b242b841c7c679a26cee077e87387536 |
| hovercard-subject-tag | issue:2141849967 |
| 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/bpython/bpython/1011/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a62677f5771e98cb79d77f940cd87fb4197ef8a1ef396604c41eb167f4e2f6f8/bpython/bpython/issues/1011 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a62677f5771e98cb79d77f940cd87fb4197ef8a1ef396604c41eb167f4e2f6f8/bpython/bpython/issues/1011 |
| og:image:alt | Consider the following code (which rightly generates a SyntaxError): >>> counter = 0 >>> def increment(): ... counter += 1 ... global counter In the Python REPL, this generates the following error:... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | djaychela |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1a6a4ac66aaa8be0077b72a69fd56fb51cd11215a1e31f0365079e012987234a |
| turbo-cache-control | no-preview |
| go-import | github.com/bpython/bpython git https://github.com/bpython/bpython.git |
| octolytics-dimension-user_id | 8071396 |
| octolytics-dimension-user_login | bpython |
| octolytics-dimension-repository_id | 21508865 |
| octolytics-dimension-repository_nwo | bpython/bpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 21508865 |
| octolytics-dimension-repository_network_root_nwo | bpython/bpython |
| 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 | 045909cd564d790cacd96dcb8722039dff679d63 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width