diff options
author | Benjamin Peterson <benjamin@python.org> | 2013-06-02 22:19:26 -0700 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2013-06-02 22:19:26 -0700 |
commit | f47ef217063194123ac63785f23907c3f4d1b271 (patch) | |
tree | 2b0ecac5f309e083917cc1e9aac5c2008a7ebe8c /documentation/index.rst | |
parent | 4a755dc17294e71969a146d2b3e7b87db083c735 (diff) | |
download | six-f47ef217063194123ac63785f23907c3f4d1b271.tar.gz |
add byte2int (fixes #26)
Diffstat (limited to 'documentation/index.rst')
-rw-r--r-- | documentation/index.rst | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/documentation/index.rst b/documentation/index.rst index d60328a..3755d52 100644 --- a/documentation/index.rst +++ b/documentation/index.rst @@ -330,6 +330,12 @@ string data in all Python versions. equivalent to :func:`py2:chr` in Python 2 and ``bytes((i,))`` in Python 3. +.. function:: byte2int(bs) + + Converts the first byte of *bs* to an integer. This is equivalent to + ``ord(bs[0])`` on Python 2 and ``bs[0]`` on Python 3. + + .. function:: indexbytes(buf, i) Return the byte at index *i* of *buf* as an integer. This is equivalent to |