Skip to content

Commit fa21675

Browse files
authored
Merge pull request #16425 from tacaswell/mnt_rename_internals
MNT: rename internal variable
2 parents b2e6e6d + 9a7ddd3 commit fa21675

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

lib/matplotlib/mathtext.py

+9-8
Original file line numberDiff line numberDiff line change
@@ -2354,7 +2354,7 @@ def __init__(self):
23542354
p.simple = Forward()
23552355
p.simple_group = Forward()
23562356
p.single_symbol = Forward()
2357-
p.snowflake = Forward()
2357+
p.accentprefixed = Forward()
23582358
p.space = Forward()
23592359
p.sqrt = Forward()
23602360
p.stackrel = Forward()
@@ -2391,7 +2391,7 @@ def __init__(self):
23912391
p.single_symbol <<= Regex(
23922392
r"([a-zA-Z0-9 +\-*/<>=:,.;!\?&'@()\[\]|%s])|(\\[%%${}\[\]_|])" %
23932393
unicode_range)
2394-
p.snowflake <<= Suppress(p.bslash) + oneOf(self._snowflake)
2394+
p.accentprefixed <<= Suppress(p.bslash) + oneOf(self._accentprefixed)
23952395
p.symbol_name <<= (
23962396
Combine(p.bslash + oneOf(list(tex2uni)))
23972397
+ FollowedBy(Regex("[^A-Za-z]").leaveWhitespace() | StringEnd())
@@ -2494,8 +2494,8 @@ def __init__(self):
24942494
)
24952495

24962496
p.placeable <<= (
2497-
p.snowflake # Must be before accent so named symbols that are
2498-
# prefixed with an accent name work
2497+
p.accentprefixed # Must be before accent so named symbols that are
2498+
# prefixed with an accent name work
24992499
| p.accent # Must be before symbol as all accents are symbols
25002500
| p.symbol # Must be third to catch all named symbols and single
25012501
# chars not in a group
@@ -2742,7 +2742,7 @@ def symbol(self, s, loc, toks):
27422742
do_kern = True)]
27432743
return [char]
27442744

2745-
snowflake = symbol
2745+
accentprefixed = symbol
27462746

27472747
def unknown_symbol(self, s, loc, toks):
27482748
c = toks[0]
@@ -2816,9 +2816,10 @@ def c_over_c(self, s, loc, toks):
28162816
_wide_accents = set(r"widehat widetilde widebar".split())
28172817

28182818
# make a lambda and call it to get the namespace right
2819-
_snowflake = (lambda am: [p for p in tex2uni if
2820-
any(p.startswith(a) and a != p for a in am)])(
2821-
set(_accent_map))
2819+
_accentprefixed = (lambda am: [
2820+
p for p in tex2uni
2821+
if any(p.startswith(a) and a != p for a in am)
2822+
])(set(_accent_map))
28222823

28232824
def accent(self, s, loc, toks):
28242825
assert len(toks) == 1

lib/matplotlib/tests/test_mathtext.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
r'${xyz}^k{x}_{k}{x}^{p}{y}^{p-2} {d}_{i}^{j}{b}_{j}{c}_{k}{d} {x}^{j}_{i}{E}^{0}{E}^0_u$',
102102
r'${\int}_x^x x\oint_x^x x\int_{X}^{X}x\int_x x \int^x x \int_{x} x\int^{x}{\int}_{x} x{\int}^{x}_{x}x$',
103103
r'testing$^{123}$',
104-
' '.join('$\\' + p + '$' for p in sorted(mathtext.Parser._snowflake)),
104+
' '.join('$\\' + p + '$' for p in sorted(mathtext.Parser._accentprefixed)),
105105
r'$6-2$; $-2$; $ -2$; ${-2}$; ${ -2}$; $20^{+3}_{-2}$',
106106
r'$\overline{\omega}^x \frac{1}{2}_0^x$', # github issue #5444
107107
r'$,$ $.$ $1{,}234{, }567{ , }890$ and $1,234,567,890$', # github issue 5799

0 commit comments

Comments
 (0)