This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author abarnert
Recipients abarnert, docs@python
Date 2016-02-02.18:43:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1454438589.41.0.991764109365.issue26267@psf.upfronthosting.co.za>
In-reply-to
Content
Most real-world code that uses the UUID module wants either the standard format '{12345678-1234-5678-1234-567812345678}', or the same thing without the braces.

There are a number of different documented accessors, but none of them give you either of these. The simplest way I can think of to guarantee the standard format from what's documented is '{%08x-%04x-%04x-%02x%02x-%12x}' % u.fields.

It might be nice to add accessors for standard form and braceless standard form, but that probably isn't necessary--as long as there's documentation saying that __str__ returns the braceless standard form.

The example code does say that, but I don't think people can trust that a comment in an example is binding documentation--plus, plenty of people don't read the examples looking for more information about things that aren't documented. And I've seen people come up with buggy versions of the format string that miss leading zeros, or horrible things like repr(u)[6:42].
History
Date User Action Args
2016-02-02 18:43:09abarnertsetrecipients: + abarnert, docs@python
2016-02-02 18:43:09abarnertsetmessageid: <1454438589.41.0.991764109365.issue26267@psf.upfronthosting.co.za>
2016-02-02 18:43:09abarnertlinkissue26267 messages
2016-02-02 18:43:09abarnertcreate