Skip to content

SyntaxError of global declaration don't stop program #72

Closed
@HyeockJinKim

Description

@HyeockJinKim
a = 3
global a
print(a)

b = 2 + 5
print(b)

This code generate syntax error, but gpython doesn't stop program

Expected Result

Hyeockz:bin hyeockjinkim$ python3 g.py 
  File "g.py", line 2
    global a
SyntaxError: name 'a' is assigned to before global declaration

Actual Result

2019/09/09 00:08:36 name 'a' is assigned to before global declaration
3
7

SyntaxError in python3 is Error, not warning. So I think it should be modified.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy