Skip to content

false nonlocal binding error for __class__ #2008

@youknowone

Description

@youknowone

Feature

class A:
    def f(self):
        nonlocal __class__
        __class__ = int

This is legal code in Python but raising error in RustPython:

SyntaxError: no binding for nonlocal '__class__' found at line 0 column 0

Python Documentation

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-compatA discrepancy between RustPython and CPython

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions