Skip to content

Clarify signification of Annotation #1805

Closed

Description

@Viicos

#1669 Clarified usage of Final in dataclasses. The following section was added:

``Final`` may be wrapped only by other type qualifiers (e.g. ``ClassVar`` or
``Annotation``). It cannot be used in a type parameter (e.g.
``list[Final[int]]`` is not permitted.)

I believe Annotation means Annotated? If so, I can open a PR fixing this.


Ideally we could also update the conformance tests to add an extra final_annotated: Annotated[Final[int], ...]. It will be interesting to see the output, as mypy seems to reject it.

Activity

  1. JelleZijlstra commented on Jul 16, 2024

    @JelleZijlstra
    Member

    Good call, that should say Annotated. And yes, the conformance test suite should be expanded to cover those, and mypy should be fixed to follow the spec here.

  2. erictraut commented on Jul 16, 2024

    @erictraut
    Collaborator

    The conformance tests already cover this case, and mypy's nonconformance has already been noted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions