[pypy-issue] Issue #2838: {*iterator} does not behave like set(iterator). (pypy/pypy)

dudu bs issues-reply at bitbucket.org
Sun May 27 04:47:24 EDT 2018


New issue 2838: {*iterator} does not behave like set(iterator).
https://bitbucket.org/pypy/pypy/issues/2838/iterator-does-not-behave-like-set-iterator

dudu bs:

When I convert iterator to set using the expression {*x}  exceptions that are thrown away by 'x' disappear as opposed to using expression set(x) 
```
#!python
def gen():
    yield 1
    raise TypeError()

test1 = {*gen()} # not raised
test2 = set(gen()) # raised
```




More information about the pypy-issue mailing list