← 返回首页
global SyntaxError different in Python REPL vs Bpython · Issue #1011 · bpython/bpython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

global SyntaxError different in Python REPL vs Bpython #1011

New issue
New issue

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

However, in Bpython, the following error occurs:

SyntaxError: incomplete input

The Bpython error appears to be incorrect to me?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Footer

      © 2026 GitHub, Inc.