Re:Do these 2 lines compile to the same Bytecode? (Posting On Python-List Prohibited)

Liste des GroupesRevenir à cl python 
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.python
Date : 17. Jun 2024, 01: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>

Date Sujet#  Auteur
16 Jun 24 * - for (i, j) in zip(x, x[1:])) - for i, j in zip(x, x[1:])) Do these 2 lines compile to the same Bytecode?2HenHanna
17 Jun 24 `- Re: Do these 2 lines compile to the same Bytecode? (Posting On Python-List Prohibited)1Lawrence D'Oliveiro

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal