-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Create RCKeyType #30316
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
Create RCKeyType #30316
Conversation
|
Hi @ZPyrolink do you need some help getting this PR ready for review? |
# Conflicts: # lib/matplotlib/typing.py
|
Hi, sorry, I was taking a break and forgot to push my last commit and set the PR as ready for review. I only had one problem with mypy corrected with a use of RcKeyType and # type: ignore[index] (I don't know if there is another solution for this one). |
| super().__init__(default_font_prop, load_glyph_flags) | ||
| for texfont in "cal rm tt it bf sf bfit".split(): | ||
| prop = mpl.rcParams['mathtext.' + texfont] | ||
| prop = mpl.rcParams['mathtext.' + texfont] # type: ignore[index] |
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.
There is no getter for a group so I think ignoring the error is the only solution.
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 assume mypy is complaining here. Would it help to make the list explicit?
for texfont in ["cal", "rm", "tt", "it", "bf", "sf", "bfit"]: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.
Unfortunately mypy consider textfont as a str and the sum also as str so we have the same error
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 in that case, ignoring is likely the simplest solution.
| super().__init__(default_font_prop, load_glyph_flags) | ||
| for texfont in "cal rm tt it bf sf bfit".split(): | ||
| prop = mpl.rcParams['mathtext.' + texfont] | ||
| prop = mpl.rcParams['mathtext.' + texfont] # type: ignore[index] |
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 in that case, ignoring is likely the simplest solution.
|
This is a bit outdated, but I'm going to merge and open a followup PR. |
PR summary
This PR create types for the RC (Runtime Configuration)
RcKeyTypeRcGroupTypeThese types are used on:
RcParams.__setitem__RcParams.__getitem__matplotlib.rcPR checklist