GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — global SyntaxError different in Python REPL vs Bpython · Issue #1011 · bpython/bpython

global SyntaxError different in Python REPL vs Bpython #1011

New issue
Copy link
New issue
Copy link
Open
Open
global SyntaxError different in Python REPL vs Bpython#1011
Copy link
Labels
bug

Description

@djaychela
djaychela
opened on Feb 19, 2024
Issue body actions

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?

Activity

  1. sebastinas
    added
    bug
    on Feb 19, 2024
  2. dbzix commented on May 9, 2024

    @dbzix
    dbzix
    on May 9, 2024
    More actions

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.