'Produce unique values on demand simply by incrementing an integer in python
Based on that answer I was wondering how to implement this.
The goal is to have unique numbers. They have to be unique in the process not outside of it. So the recommendation was just to count.
import sys
i = iter(range(sys.maxsize))
# calling this will give you the next number
next(i)
What do you think about this approach?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
