Posts: 4,559
Threads: 1,464
Joined: Sep 2016
given an iterable object (such as a list) that was used as the argument of iter() and the value returned from it, and subsequently used, is there a way to determine how many times it has been used, without actually using it any more?
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,559
Threads: 1,464
Joined: Sep 2016
i'll try countable().
i guess this thinking is from my assembly/C upbringing. i was thinking of the iterator i get from iter() as like a pointer moving over the argument (think of next() as incrementing it). if i did
p=iter(x)
then i was originally hoping
p-x
would give me that count like it would in C. but that operation is not implemented. it has to keep track of where it is so i'm thinking it could be implemented. but few people would ever need it. i haven't until now.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.