You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Even though the traceback points at ast.unparse(tree), I suspect the visit_Expr() method is the place to look.
Yup. We may have an issue there. But basic math doesn't fail, AFAK, so maybe it's the nesting.
Parsing and unparsing the code directly using ast.parse() and ast.unparse works just fine. But it is weird that an uninstantiated dataclass (which is a shortcut class) would create any issues at all. Especially since uninstantiated classes don't create issues.
🤔 .....although, it might be the decorator specifically. That doesn't explain the issues with the try -- except.
I'll take a look this afternoon. Thanks for reporting this!
# Pass through generator code.ifisinstance(node.value, Yield):
returnnode
Did not account for other possible top-level unassigned expressions. For the most part, this wouldn't get triggered by student code because most things inside functions get assigned names (...right up until they don't get assigned names 🤦🏽♀️ ). But a biggie is that it didn't account for hanging lambda expressions. UGH.
So that we have a record, the ast.Expr types we needed to account for in the above are:
However, if we look explicitly for Constant, we don't have to be explicit with the skips.
So, I eliminated that code, and adjusted the eliminate registered docstrings code to read:
Alrighty. PR'd a fix for this here. Should you want to play with it using docker, you will need to pull the PR branch and rebuild the container by using docker build -t exercism/python-representer . from your exercism/python-representer directory.
Let me know if you have questions or issues. Many thanks again for finding this. 😄
We may need to wait until Erik is back from vacation to merge this. I don't think that's a huge deal, but if you think this migtht be critical, we can ask iHiD to review and merge for us.
On Thu, Mar 21, 2024, 5:39 PM BethanyG ***@***.***> wrote:
Alrighty. PR'd a fix for this here
<#55>. Should you want
to play with it using docker, you will need to pull the PR branch and
rebuild the container by using docker build -t
exercism/python-representer . from your exercism/python-representer
directory.
Let me know if you have questions or issues. Many thanks again for finding
this. 😄
We may need to wait until Erik is back from vacation to merge this. I
don't think that's a huge deal, but if you think this migth be critical, we
can ask iHiD to review and merge for us.
—
Reply to this email directly, view it on GitHub
<#54 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACBULKUOPAH4B4GSSJJA2NLYZNVUBAVCNFSM6AAAAABFBV3O4SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJUGA2TCNRXGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
Activity
github-actions commentedon Mar 21, 2024
BethanyG commentedon Mar 21, 2024
sigh. That auto-close bot sure is aggressive.
Yup. We may have an issue there. But basic math doesn't fail, AFAK, so maybe it's the nesting.
Parsing and unparsing the code directly using
ast.parse()andast.unparseworks just fine. But it is weird that an uninstantiateddataclass(which is a shortcut class) would create any issues at all. Especially since uninstantiated classes don't create issues.🤔 .....although, it might be the decorator specifically. That doesn't explain the issues with the
try--except.I'll take a look this afternoon. Thanks for reporting this!
BethanyG commentedon Mar 21, 2024
UPDATE:
Starting at line 314
This code:
Did not account for other possible top-level unassigned expressions. For the most part, this wouldn't get triggered by student code because most things inside functions get assigned names (...right up until they don't get assigned names 🤦🏽♀️ ). But a biggie is that it didn't account for hanging
lambdaexpressions. UGH.So that we have a record, the
ast.Exprtypes we needed to account for in the above are:UnaryOp, BinOp, BoolOp, Lambda, ListComp, DictComp, SetComp, GenExpr, Yield, YieldFrom
However, if we look explicitly for
Constant, we don't have to be explicit with the skips.So, I eliminated that code, and adjusted the
eliminate registered docstringscode to read:But I now have some tests failing, so need to make sure I haven't munged something else. Will keep you posted. 😄
BethanyG commentedon Mar 21, 2024
Alrighty. PR'd a fix for this here. Should you want to play with it using docker, you will need to pull the PR branch and rebuild the container by using
docker build -t exercism/python-representer .from yourexercism/python-representerdirectory.Let me know if you have questions or issues. Many thanks again for finding this. 😄
We may need to wait until Erik is back from vacation to merge this. I don't think that's a huge deal, but if you think this migtht be critical, we can ask iHiD to review and merge for us.
brocla commentedon Mar 22, 2024
BethanyG commentedon Mar 27, 2024
PR #55 has been merged 🎉 . Closing this as fixed (at least until we find the next bug). 😄