fix: add AugAssign and AnnAssign support to InternalPythonInterpreter#3960
fix: add AugAssign and AnnAssign support to InternalPythonInterpreter#3960r266-tech wants to merge 1 commit intocamel-ai:masterfrom
Conversation
Fixes camel-ai#418 - Add _execute_augassign() method supporting all augmented assignment operators: +=, -=, *=, /=, //=, %=, **, <<, >>, &, |, ^, @ - Add _execute_annassign() method for annotated assignments (e.g. x: int = 5) - Update test_expression_not_support to test_augassign_add (now passes) - Add tests for multiple augassign operators and annotated assignments
There was a problem hiding this comment.
Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit in Settings → Usage.
Once credits are available, reopen this pull request to trigger a review.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip You can disable sequence diagrams in the walkthrough.Disable the |
Related Issue
Fixes #418
Description
The currently raises when encountering augmented assignment operators like . This is a commonly-used Python construct that should be supported.
Changes
_execute_augassign(): New method handling all augmented assignment operators:+=,-=,*=,/=,//=,%=,**=<<=,>>=,&=,|=,^=@=x += 1) and subscript targets (lst[0] += 1)_execute_annassign(): New method handling annotated assignments (e.g.,x: int = 5). Declarations without values (e.g.,x: int) returnNone.Tests: Updated the existing test that expected AugAssign to fail, replaced with comprehensive tests for all operators and annotated assignments.
Verification
Checklist