exaloop / exaloop/codon

Weirdness with unpacking.

Open
#617 1 comment 0 reactions 1 assignee Claimed by @inumanag View on GitHub
bug
Dominant language
Python
Stars
16.8k
Forks
603
Avg merge
4d 23h
Merged PRs (30d)
6

Description

The following valid Python programs fail to build via `codon build`. They will build if slightly edited.
```sh
$ codon --version
0.17.0
```
```py
def u():
yield 1,2,3
[[x,y,z]] = u() # fix via [[x,y,z]] = list(u()) or [x,y,z] = next(u())
# cex.py:3:13-16: error: 'Generator[Tuple[int,int,int]]' object has no attribute '__getitem__'
```
```py
x, y = 0,0
while (x,y) == (0,0):
[(x,y)] = [(0,0)] # fix via ((x,y),) = [(0,0)]
# cex.py:3:5-22: error: 'Tuple[int,int]' does not match expected type 'int'
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.