[Python] Lazy evaluation in Python

Discussão em 'Python' iniciado por Stack, Março 1, 2025.

  1. Stack

    Stack Membro Participativo

    What is lazy evaluation in Python?

    One website said :

    In Python 3.x the range() function returns a special range object which computes elements of the list on demand (lazy or deferred evaluation):

    >>> r = range(10)
    >>> print(r)
    range(0, 10)
    >>> print(r[3])
    3


    What is meant by this?

    Continue reading...

Compartilhe esta Página