Skip to content

"if 0: return" not raising SyntaxError #46183

@arigo

Description

@arigo
mannequin
BPO 1875
Nosy @amauryfa, @mdickinson, @cfbolz, @benjaminp, @ned-deily, @serhiy-storchaka, @matrixise, @pablogsal, @miss-islington
PRs
  • bpo-1875: Raise SyntaxError in invalid blocks that will be optimized away #13332
  • [3.7] bpo-1875: Raise SyntaxError in invalid blocks that will be optimised away (GH-13332) #13382
  • bpo-1875, bpo-32477: Raise SyntaxError in invalid blocks that will be optimized away. #14116
  • Files
  • x.py
  • return_outside_func.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/amauryfa'
    closed_at = <Date 2019-12-02.22:41:47.934>
    created_at = <Date 2008-01-19.18:55:49.322>
    labels = ['interpreter-core', '3.8', 'type-bug', '3.7']
    title = '"if 0: return" not raising SyntaxError'
    updated_at = <Date 2019-12-02.22:41:47.933>
    user = 'https://github.com/arigo'

    bugs.python.org fields:

    activity = <Date 2019-12-02.22:41:47.933>
    actor = 'pablogsal'
    assignee = 'amaury.forgeotdarc'
    closed = True
    closed_date = <Date 2019-12-02.22:41:47.934>
    closer = 'pablogsal'
    components = ['Interpreter Core']
    creation = <Date 2008-01-19.18:55:49.322>
    creator = 'arigo'
    dependencies = []
    files = ['9231', '12926']
    hgrepos = []
    issue_num = 1875
    keywords = ['patch', 'needs review']
    message_count = 15.0
    messages = ['60213', '61638', '80955', '80961', '81019', '81023', '116917', '342464', '342525', '342555', '342559', '342705', '342706', '345684', '347350']
    nosy_count = 12.0
    nosy_names = ['amaury.forgeotdarc', 'mark.dickinson', 'fijal', 'Carl.Friedrich.Bolz', 'benjamin.peterson', 'ned.deily', 'Arfrever', 'mastrodomenico', 'serhiy.storchaka', 'matrixise', 'pablogsal', 'miss-islington']
    pr_nums = ['13332', '13382', '14116']
    priority = 'low'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue1875'
    versions = ['Python 3.7', 'Python 3.8']

    Metadata

    Metadata

    Assignees

    Labels

    3.7 (EOL)end of life3.8 (EOL)end of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions