logoalt Hacker News

dist-epochyesterday at 12:30 PM1 replyview on HN

> Basically you are just asking for one of the parameters it was created with.

See, you already made a mistake:

    >>> min(range(10, 1, -3))
    4
4 is neither the min or max of the range (their actual names are start and stop), and notice how the max is the first argument and the min is the second argument

Of course, the actual implementation of constant time min/max on range would be trivial.


Replies

d0mineyesterday at 6:10 PM

4 is the min of the range (stop (1 here) is never included (by definition. Ask Dijkstra why))

show 1 reply