Skip to content

Spurious final errors in function referencing undefined variable #7229

Closed
@msullivan

Description

@msullivan
from typing_extensions import Final

class A:
    def __init__(self) -> None:
        self.x = 10  # type: Final
        asdf  # type: ignore

produces the error Cannot redefine an existing name as final.

My assumption is that this has to do with deferred nodes, though a few attempts to produce this error in another way failed.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions