Skip to content

Fix MarkerStyle types #25825

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

Merged
merged 2 commits into from
May 31, 2023
Merged

Fix MarkerStyle types #25825

merged 2 commits into from
May 31, 2023

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented May 6, 2023

PR summary

When the {Cap,Join}Style Enum classes were added in #18544, they were supposed to be for documentation only. To that end, #22055 was a followup that ensured that only the strings were exposed from the getter side.

However, when user-supplied cap/join style were added in #20914, they were only for the Enum type instead of the string, so correctly allow strings here as well. Also, specifically type hint the return values as literals, as was done in #25719.

It is not possible for get_marker to return another MarkerStyle; the __init__ only takes one to make a full copy of it. And get_alt_path is only available for e.g., half-filled markers, but not all.

PR checklist

QuLogic added 2 commits May 31, 2023 02:17
When these Enum classes were added in matplotlib#18544, they were supposed to be
for documentation only. To that end, matplotlib#22055 was a followup that ensured
that only the strings were exposed from the getter side.

However, when user-supplied cap/join style were added in matplotlib#20914, they
were only for the Enum type instead of the string, so correctly allow
strings here as well.

Also, specifically type hint the return values as literals, as was done
in matplotlib#25719.
It is not possible for `get_marker` to return another `MarkerStyle`; the
`__init__` only takes one to make a full copy of it. And `get_alt_path`
is only available for e.g., half-filled markers, but not all.
@tacaswell tacaswell merged commit f6a781f into matplotlib:main May 31, 2023
@QuLogic QuLogic deleted the marker-types branch May 31, 2023 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants