Fredrik Lundh wrote:
> Ka-Ping Yee wrote:
> 
> > Quite a few people have expressed interest in having UUID
> > functionality in the standard library, and previously on this
> > list some suggested possibly using the uuid.py module i wrote:
> > 
> >     http://zesty.ca/python/uuid.py
> 
> +1!

+1 as well.

I have a couple of suggestions for improving that implementation:

1. You're currently using os.urandom, which can raise a NotImplementedError. 
You should be prepared to fall back on a different PRNG... which leads to the
2nd suggestion:

2. random.randrange is a method on a default random.Random instance that,
although seeded by urandom (if available), may not be the user's preferred
PRNG.  I recommend making it possible for the user to supply their own
random.Random instance for use by the module.

That's all. :)
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to