Skip to content

Python tool for converting files and office documents to Markdown.

Use frozenset for OMML direct tag lookup (#1919)

Amit Anand44f3a0ed710c
diff --git a/packages/markitdown/src/markitdown/converter_utils/docx/math/omml.py b/packages/markitdown/src/markitdown/converter_utils/docx/math/omml.py
index 6f5d1e83..5a014384 100644
--- a/packages/markitdown/src/markitdown/converter_utils/docx/math/omml.py
+++ b/packages/markitdown/src/markitdown/converter_utils/docx/math/omml.py
@@ -179,7 +179,9 @@ class oMath2Latex(Tag2Method):
_t_dict = T
- __direct_tags = ("box", "sSub", "sSup", "sSubSup", "num", "den", "deg", "e")
+ __direct_tags = frozenset(
+ ("box", "sSub", "sSup", "sSubSup", "num", "den", "deg", "e")
+ )
def __init__(self, element):
self._latex = self.process_children(element)