-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Description
Bug summary
I don't understand what this piece of code means:
matplotlib/lib/matplotlib/sphinxext/mathmpl.py
Lines 98 to 99 in a1eef38
math_role.options = {'fontset': fontset_choice, | |
'fontsize': validate_float_or_None} |
It appears just after the definition of a
math_role()
function:matplotlib/lib/matplotlib/sphinxext/mathmpl.py
Lines 88 to 89 in a1eef38
def math_role(role, rawtext, text, lineno, inliner, | |
options={}, content=[]): |
Because of that, it is "legal", but it doesn't seem to serve any purpose and is confusing.
Noticed this issue while working on #21402, which is precisely about the incorrectly mutable default value of argument options
, so it might be related.
Code for reproduction
def math_role(role, rawtext, text, lineno, inliner,
options={}, content=[]):
[...]
math_role.options = {'fontset': fontset_choice,
'fontsize': validate_float_or_None}
Actual outcome
Line doesn't have any effect, as far as I can understand:
matplotlib/lib/matplotlib/sphinxext/mathmpl.py
Lines 98 to 99 in a1eef38
math_role.options = {'fontset': fontset_choice, | |
'fontsize': validate_float_or_None} |
Expected outcome
Line should be removed:
matplotlib/lib/matplotlib/sphinxext/mathmpl.py
Lines 98 to 99 in a1eef38
math_role.options = {'fontset': fontset_choice, | |
'fontsize': validate_float_or_None} |
Operating system
No response
Matplotlib Version
@master
Matplotlib Backend
No response
Python version
No response
Jupyter version
No response
Other libraries
No response
Installation
source
Conda channel
No response