On Tue, 27 Jul 2010 04:29:31 am anatoly techtonik wrote: > I find "\xXX\xXX\xXX\xXX..." notation for binary data totally > unreadable. Everybody who uses and analyses binary data is more > familiar with plain hex dumps in the form of "XX XX XX XX...". > > I wonder if it is possible to introduce an effective binary string > type that will be represented as h"XX XX XX" in language syntax? It > will be much easier to analyze printed binary data and copy/paste > such data as-is from hex editors/views.
With the moratorium on new language features, this would not even be considered until Python 3.3. If you are serious in pursuing this idea, it is off-topic for this list and should be taken to python-ideas, or even python-list for community feedback, first. Since it only takes a pair of small helper functions to convert hex dumps in the form "XXXX XXXX ..." to and from byte strings, I don't see the need for new syntax and would vote -1 on the idea. However, I'd vote +0 on a matching bytes.tohex() method to partner with the existing bytes.fromhex(). -- Steven D'Aprano _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com