Function docstring and reduce_assignments enabled does not play nice
ckming102 opened this issue · 2 comments
ckming102 commented
Environment
- OS: Windows10
- Python: 3.10.8
- Latexify version: 0.4.1
Description
Enabling assignment reductions with a function docstring gives LatexifyNotSupportedError
.
Reproduction
Running
@latexify.function(
reduce_assignments=True,
)
def f(x):
"""doc string"""
y = x + 1
return 2 * y
f
gives LatexifyNotSupportedError: AssignmentReducer supports only Assign nodes, but got: Expr
Expected behavior
odashi commented
Thanks! It looks we need a specific conditioning to ignore docstrings from this processing.
ckming102 commented
sugoi !!!