A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2014-January/131090.html below:

[Python-Dev] RFC: PEP 460: Add bytes % args and bytes.format(args) to Python 3.5

[Python-Dev] RFC: PEP 460: Add bytes % args and bytes.format(args) to Python 3.5 [Python-Dev] RFC: PEP 460: Add bytes % args and bytes.format(args) to Python 3.5Antoine Pitrou solipsis at pitrou.net
Thu Jan 9 13:48:03 CET 2014
On Thu, 09 Jan 2014 03:54:13 +0000
MRAB <python at mrabarnett.plus.com> wrote:
> I'm thinking that the "i" format could be used for signed integers and
> the "u" for unsigned integers. The width would be the number of bytes.
> You would also need to have a way of specifying the endianness.
> 
> For example:
> 
>  >>> b'{:<2i}'.format(256)
> b'\x01\x00'
>  >>> b'{:>2i}'.format(256)
> b'\x00\x01'

The goal is not to add an alternative to the struct module. If you need
binary packing/unpacking, just use struct.

Regards

Antoine.


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4