Skip to content

Conversation

@danieleades
Copy link
Contributor

@danieleades danieleades commented Mar 3, 2024

@JelleZijlstra i wasn't sure the best way to annotate the class variables in this one, since they are literal values (not changed at runtime) but can in principle be overridden by subclasses. What's the usual approach?

@danieleades danieleades marked this pull request as ready for review March 3, 2024 09:11
@danieleades
Copy link
Contributor Author

pyright doesn't like the untyped base class

@github-actions

This comment has been minimized.

@danieleades
Copy link
Contributor Author

this is blocked on #11525, which is in turn blocked on #11469

@JelleZijlstra
Copy link
Member

@JelleZijlstra i wasn't sure the best way to annotate the class variables in this one, since they are literal values (not changed at runtime) but can in principle be overridden by subclasses. What's the usual approach?

If a subclass can override them to any value of type T (where T is e.g. str or int), I'd allocate them as ClassVar[T].

@danieleades danieleades force-pushed the docutils.parsers.rst.directives.misc branch 2 times, most recently from 07f03b1 to 9c98b26 Compare March 3, 2024 16:59
@github-actions

This comment has been minimized.

@danieleades danieleades force-pushed the docutils.parsers.rst.directives.misc branch from 9c98b26 to 9835a17 Compare March 8, 2024 06:21
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@danieleades danieleades force-pushed the docutils.parsers.rst.directives.misc branch from 8da240e to e27686d Compare March 8, 2024 16:31
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@danieleades danieleades force-pushed the docutils.parsers.rst.directives.misc branch from 86a8866 to f8fd824 Compare March 8, 2024 17:37
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@JelleZijlstra JelleZijlstra merged commit 15536bd into python:main Mar 13, 2024
@danieleades danieleades deleted the docutils.parsers.rst.directives.misc branch March 13, 2024 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants