Skip to content

Issue with list comprehension #101

Closed
@oroppas

Description

@oroppas

Hi,

The simple list comprehension does not seem to work.

libs = 'mkl , , openblas, blis, '
print(libs)
print([b for b in [a.strip() for a in libs.split(',')] if b])

CPython

mkl , , openblas, blis, 
['mkl', 'openblas', 'blis']

Graal Python

Traceback (most recent call last):
  File "/home/ryutas/graalpython/list_comprehension/test.py", line 3, in <module 'test.py'>
    print([b for b in [a.strip() for a in libs.split(',')] if b])
NameError: name 'a' is not defined

Could this be a bug in Graal Python?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions