Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

global SyntaxError different in Python REPL vs Bpython #1011

Open
djaychela opened this issue Feb 19, 2024 · 1 comment
Open

global SyntaxError different in Python REPL vs Bpython #1011

djaychela opened this issue Feb 19, 2024 · 1 comment
Labels

Comments

@djaychela
Copy link

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 to before global declaration

However, in Bpython, the following error occurs:

SyntaxError: incomplete input

The Bpython error appears to be incorrect to me?

@sebastinas sebastinas added the bug label Feb 19, 2024
@dbzix
Copy link

dbzix commented May 9, 2024

BTW, you get the same result while using the standard IDLE tool.
See attachment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants