Skip to content

support typing.Final annotation #158

Open
@carljm

Description

@carljm

Doc: https://docs.python.org/3/library/typing.html#typing.Final
Spec: https://typing.python.org/en/latest/spec/qualifiers.html#uppercase-final

  • Infer the type of the RHS for public uses of bare Final symbols
  • Add a new diagnostic for modifications of Final-qualified symbols
  • Make sure that both of the above also works for attributes
  • Prevent overriding of Final attributes in subclasses
  • Report an error if there is no binding to a Final-qualified symbol
  • Disallow Final in function parameter definitions
  • Variance inference: if an attribute is marked Final, its type should be covariant rather than invariant

Somewhat related tickets: #433, #529

Metadata

Metadata

Assignees

Labels

typing semanticstyping-module features, spec compliance, etc

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions