Sujet : Re:Do these 2 lines compile to the same Bytecode? (Posting On Python-List Prohibited)
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.lang.pythonDate : 17. Jun 2024, 00:58:15
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v4nu6n$9hu9$3@dont-email.me>
References : 1
User-Agent : Pan/0.158 (Avdiivka; )
On Sun, 16 Jun 2024 11:10:43 -0700, HenHanna wrote:
def diff1(x):
return all(abs(i-j) == 1 for (i, j) in zip(x, x[1:]))
- for (i, j) in zip(x, x[1:]))
- for i, j in zip(x, x[1:]))
Do the above 2 lines compile to the same Bytecode?
Try it for yourself and see. Tips on how to proceed:
<
https://gitlab.com/ldo/python_topics_notebooks/-/blob/master/Python%20Language%20Services.ipynb?ref_type=heads>