-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[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
base: main
Are you sure you want to change the base?
Conversation
MarkerType: TypeAlias = str | path.Path | MarkerStyle | ||
MarkerType: TypeAlias = ( | ||
path.Path | MarkerStyle | str | # str required for "$...$" marker | ||
Literal[ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the silence.
Just wanted to check: would you prefer that I remove the string literals? I'll adjust the code accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, let's keep them.
Co-authored-by: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com>
PR summary
This PR update the
MarkerType
Literal
for acceptedstr
andint
valueslist
for acceptverts
tuple
for accept regular polygon, star-like and asteriskPR checklist