[New-bugs-announce] [issue26267] UUID docs should say how to get "standard form"

Andrew Barnert report at bugs.python.org
Tue Feb 2 13:43:09 EST 2016

New submission from Andrew Barnert:

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].

assignee: docs at python
components: Documentation
messages: 259414
nosy: abarnert, docs at python
priority: normal
severity: normal
status: open
title: UUID docs should say how to get "standard form"
type: enhancement

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list