Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2918b73

Browse filesBrowse files
authored
Merge pull request #30119 from jkseppan/mathtext-type-fix
Add some types to _mathtext.py
2 parents 3623a1a + ea5d85f commit 2918b73
Copy full SHA for 2918b73

File tree

Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed

‎lib/matplotlib/_mathtext.py

Copy file name to clipboardExpand all lines: lib/matplotlib/_mathtext.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2524,10 +2524,10 @@ def subsuper(self, s: str, loc: int, toks: ParseResults) -> T.Any:
25242524
if len(new_children):
25252525
# remove last kern
25262526
if (isinstance(new_children[-1], Kern) and
2527-
hasattr(new_children[-2], '_metrics')):
2527+
isinstance(new_children[-2], Char)):
25282528
new_children = new_children[:-1]
25292529
last_char = new_children[-1]
2530-
if hasattr(last_char, '_metrics'):
2530+
if isinstance(last_char, Char):
25312531
last_char.width = last_char._metrics.advance
25322532
# create new Hlist without kerning
25332533
nucleus = Hlist(new_children, do_kern=False)
@@ -2603,7 +2603,7 @@ def subsuper(self, s: str, loc: int, toks: ParseResults) -> T.Any:
26032603

26042604
# Do we need to add a space after the nucleus?
26052605
# To find out, check the flag set by operatorname
2606-
spaced_nucleus = [nucleus, x]
2606+
spaced_nucleus: list[Node] = [nucleus, x]
26072607
if self._in_subscript_or_superscript:
26082608
spaced_nucleus += [self._make_space(self._space_widths[r'\,'])]
26092609
self._in_subscript_or_superscript = False

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.