Generating unique numbers?
Aahz
aahz at pythoncraft.com
Fri May 31 19:42:44 EDT 2002
In article <3CF7EBC8.4080802 at verio.net>, VanL <vlindberg at verio.net> wrote:
>
>Is there a good algorithm for generating unique numbers
>(ints, specifically) that can be used as object identifiers?
>
>I am discounding the obvious newid += 1 because I will need
>to merge different sets, and while I may have some number
>overlap, using a simple count for each object would
>guarantee that I have the maximum number of clashes.
Use a global, persistent newid.
--
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
"In the end, outside of spy agencies, people are far too trusting and
willing to help." --Ira Winkler
More information about the Python-list
mailing list