[issue46674] Two if in a row in generators

2022-02-07 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Please, stop reopening the issue. The syntax is valid python syntax and we will not be able to make it invalid -- resolution: -> not a bug status: open -> closed ___ Python tracker

[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] if x if no

[issue46674] Two if in a row in generators

2022-02-07 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: As Serhiy mentioned, this is a valid syntax. -- nosy: +BTaskaya resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue46674] Two if in a row in generators

2022-02-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is valid syntax. -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mail

[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, stsouko priority: normal sev