Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
ab7e5ef6
Commit
ab7e5ef6
authored
Aug 22, 2006
by
Anthony Baxter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
patch for documentation for recent uuid changes (from ping)
parent
19c35bba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
Doc/lib/libuuid.tex
Doc/lib/libuuid.tex
+15
-15
No files found.
Doc/lib/libuuid.tex
View file @
ab7e5ef6
...
...
@@ -18,20 +18,11 @@ may compromise privacy since it creates a UUID containing the computer's
network address.
\function
{
uuid4()
}
creates a random UUID.
\begin{classdesc}
{
UUID
}{
\optional
{
hex
\optional
{
, bytes
\optional
{
,
fields
\optional
{
, int
\optional
{
, version
}}}}}}
%Instances of the UUID class represent UUIDs as specified in RFC 4122.
%UUID objects are immutable, hashable, and usable as dictionary keys.
%Converting a UUID to a string with str() yields something in the form
%'12345678-1234-1234-1234-123456789abc'. The UUID constructor accepts
%four possible forms: a similar string of hexadecimal digits, or a
%string of 16 raw bytes as an argument named 'bytes', or a tuple of
%six integer fields (with 32-bit, 16-bit, 16-bit, 8-bit, 8-bit, and
%48-bit values respectively) as an argument named 'fields', or a single
%128-bit integer as an argument named 'int'.
bytes
_
le
\optional
{
, fields
\optional
{
, int
\optional
{
, version
}}}}}}}
Create a UUID from either a string of 32 hexadecimal digits,
a string of 16 bytes as the
\var
{
bytes
}
argument, a tuple of six
a string of 16 bytes as the
\var
{
bytes
}
argument, a string of 16 bytes
in little-endian order as the
\var
{
bytes
_
le
}
argument, a tuple of six
integers (32-bit
\var
{
time
_
low
}
, 16-bit
\var
{
time
_
mid
}
,
16-bit
\var
{
time
_
hi
_
version
}
,
8-bit
\var
{
clock
_
seq
_
hi
_
variant
}
, 8-bit
\var
{
clock
_
seq
_
low
}
, 48-bit
\var
{
node
}
)
...
...
@@ -45,22 +36,31 @@ UUID('{12345678-1234-5678-1234-567812345678}')
UUID('12345678123456781234567812345678')
UUID('urn:uuid:12345678-1234-5678-1234-567812345678')
UUID(bytes='
\x
12
\x
34
\x
56
\x
78'*4)
UUID(bytes
_
le='
\x
78
\x
56
\x
34
\x
12
\x
34
\x
12
\x
78
\x
56' +
'
\x
12
\x
34
\x
56
\x
78
\x
12
\x
34
\x
56
\x
78')
UUID(fields=(0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x567812345678))
UUID(int=0x12345678123456781234567812345678)
\end{verbatim}
Exactly one of
\var
{
hex
}
,
\var
{
bytes
}
,
\var
{
fields
}
, or
\var
{
int
}
must
Exactly one of
\var
{
hex
}
,
\var
{
bytes
}
,
\var
{
bytes
_
le
}
,
\var
{
fields
}
,
or
\var
{
int
}
must
be given. The
\var
{
version
}
argument is optional; if given, the
resulting UUID will have its variant and version number set according to
RFC 4122, overriding bits in the given
\var
{
hex
}
,
\var
{
bytes
}
,
\var
{
fields
}
, or
\var
{
int
}
.
\var
{
bytes
_
le
}
,
\var
{
fields
}
, or
\var
{
int
}
.
\end{classdesc}
\class
{
UUID
}
instances have these read-only attributes:
\begin{memberdesc}
{
bytes
}
The UUID as a 16-byte string.
The UUID as a 16-byte string (containing the six
integer fields in big-endian byte order).
\end{memberdesc}
\begin{memberdesc}
{
bytes
_
le
}
The UUID as a 16-byte string (with
\var
{
time
_
low
}
,
\var
{
time
_
mid
}
,
and
\var
{
time
_
hi
_
version
}
in little-endian byte order).
\end{memberdesc}
\begin{memberdesc}
{
fields
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment