[issue46674] Two if in a row in generators

2022-02-07 Thread Ramil Nugmanov
Ramil Nugmanov added the comment: Yes, [x for x in [1, 2, 3] if 1 if 1] can be replaced with: for x in [1, 2, 3]: if 1: if 1: yield x However this syntax is strange and leads to errors like: [x for x in [1, 2, 3] if x is not None] >> [x for x in [1, 2, 3] i

[issue46674] Two if in a row in generators

2022-02-07 Thread Ramil Nugmanov
New submission from Ramil Nugmanov : treat without error two if in generators. >>>[x for x in [1, 2, 3] if 1 if 1] [1, 2, 3] >>>[x for x in [1, 2, 3] if 0 if 1] [] expected syntax error -- components: Parser messages: 412726 nosy: lys.nikolaou, pablogsal, stsouk

[issue40806] itertools.product not lazy

2020-05-28 Thread Ramil Nugmanov
Change by Ramil Nugmanov : -- keywords: +patch pull_requests: +19741 stage: -> patch review pull_request: https://github.com/python/cpython/pull/20492 ___ Python tracker <https://bugs.python.org/issu

[issue40806] itertools.product not lazy

2020-05-28 Thread Ramil Nugmanov
New submission from Ramil Nugmanov : def x(y): while True: yield y p = product(x(1), x(2)) next(p) # this string will never be reached. -- components: Library (Lib) messages: 370201 nosy: nougmanoff priority: normal severity: normal status: open title: itertools.product