Skip to content

fix multi assign#348

Merged
Roger-luo merged 5 commits into
mainfrom
roger/fix-multi-assign-2
Apr 5, 2025
Merged

fix multi assign#348
Roger-luo merged 5 commits into
mainfrom
roger/fix-multi-assign-2

Conversation

@Roger-luo
Copy link
Copy Markdown
Collaborator

@Roger-luo Roger-luo commented Apr 5, 2025

I just realize I misinterpreted what it means when there are multiple targets in ast.Assign it actually means the following

x = y.z = 1

this also fix:

  • statement with multiple return values. Allow one create such statements without using a tuple.
  • named expr, e.g x := 1
  • ast.AugAssign, e.g x += 1

@Roger-luo Roger-luo added category: bug Category: this is a bug or something isn't working as expected. area: python lowering Area: Python lowering related issues. labels Apr 5, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 5, 2025

PR Preview Action v1.6.0
Preview removed because the pull request was closed.
2025-04-05 03:14 UTC

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 5, 2025

Codecov Report

Attention: Patch coverage is 85.18519% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/kirin/dialects/py/assign.py 85.18% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 5, 2025

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
9258 8144 88% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
src/kirin/dialects/py/assign.py 88% 🟢
TOTAL 88% 🟢

updated for commit: fb6e43b by action🐍

@Roger-luo Roger-luo merged commit e85a061 into main Apr 5, 2025
11 of 12 checks passed
@Roger-luo Roger-luo deleted the roger/fix-multi-assign-2 branch April 5, 2025 03:14
Roger-luo added a commit that referenced this pull request Apr 7, 2025
I just realize I misinterpreted what it means when there are multiple
targets in `ast.Assign` it actually means the following

```py
x = y.z = 1
```

this also fix:
- statement with multiple return values. Allow one create such
statements without using a tuple.
- named expr, e.g `x := 1`
- `ast.AugAssign`, e.g `x += 1`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: python lowering Area: Python lowering related issues. backport 0.16 category: bug Category: this is a bug or something isn't working as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant