Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Clarify signification of Annotation #1805

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Viicos opened this issue Jul 16, 2024 · 2 comments · Fixed by #1808
Closed

Clarify signification of Annotation #1805

Viicos opened this issue Jul 16, 2024 · 2 comments · Fixed by #1808
Labels
topic: documentation Documentation-related issues and PRs

Comments

@Viicos
Copy link
Contributor

Viicos commented Jul 16, 2024

#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.

@Viicos Viicos added the topic: documentation Documentation-related issues and PRs label Jul 16, 2024
@JelleZijlstra
Copy link
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.

@erictraut
Copy link
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
Labels
topic: documentation Documentation-related issues and PRs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants