[Python-Dev] enhancements for uuid module

Michael Amrhein mamrhein at users.sourceforge.net
Mon Jun 26 15:57:32 CEST 2006

Hi Ka-Ping,
I would like to propose two enhancements for your uuid module in Python 2.5:

1) I've written functions to retrieve the MAC address that do not depend 
on running external programs. Please see the attached file.

2) In order to reduce the pickle footprint of UUIDs I would add a 
__reduce__ method to class UUID like

     def __reduce__(self):
         return (uuid, (self.int,))

together with a helper function (at module level) like

def uuid(i):
     return UUID(int=i)

Please feel free to use the supplied code.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: hostid.py
Url: http://mail.python.org/pipermail/python-dev/attachments/20060626/1e85b75e/attachment.pot 

More information about the Python-Dev mailing list