8000 [MNT] [TYPING]: Update MarkerType (#30257) by ZPyrolink · Pull Request #30261 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

[MNT] [TYPING]: Update MarkerType (#30257) #30261

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ZPyrolink
Copy link
Contributor

PR summary

This PR update the MarkerType

PR checklist

MarkerType: TypeAlias = str | path.Path | MarkerStyle
MarkerType: TypeAlias = (
path.Path | MarkerStyle | str | # str required for "$...$" marker
Literal[
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we have to keep str anyway, what is the advantage of spelling out the literal string values?

we can’t detect invalid values and completion also is not a relevant benefit if the values are almost all single characters.

Copy link
Contributor Author
@ZPyrolink ZPyrolink Jul 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that we don't really get completion, but we don't lose the suggestion when the string is opened.
That said, if you prefer, I can remove this and only keep the integers.

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.

[MNT] [TYPING]: Use of Literal
2 participants
0