[issue22385] Define a binary output formatting mini-language for *.hex()

2019-10-20 Thread Gregory P. Smith
Change by Gregory P. Smith : -- resolution: -> fixed stage: patch review -> commit review status: open -> closed versions: +Python 3.9 -Python 3.8 ___ Python tracker ___ _

[issue22385] Define a binary output formatting mini-language for *.hex()

2019-05-30 Thread Gregory P. Smith
Gregory P. Smith added the comment: thanks, i'll take care of them. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue22385] Define a binary output formatting mini-language for *.hex()

2019-05-30 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: This change seems to have created some compile time warnings : https://buildbot.python.org/all/#/builders/103/builds/2544/steps/3/logs/warnings__6_ Python/pystrhex.c:18:45: warning: passing argument 1 of ‘PyObject_Size’ discards ‘const’ qualifier fr

[issue22385] Define a binary output formatting mini-language for *.hex()

2019-05-29 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset 0c2f9305640f7655ba0cd5f478948b2763b376b3 by Gregory P. Smith in branch 'master': bpo-22385: Support output separators in hex methods. (#13578) https://github.com/python/cpython/commit/0c2f9305640f7655ba0cd5f478948b2763b376b3 --

[issue22385] Define a binary output formatting mini-language for *.hex()

2019-05-25 Thread Gregory P. Smith
Gregory P. Smith added the comment: Given that we have f-strings, I don't think a format mini language makes as much sense. My PR adds support for separators to the .hex() methods (and to binascii.hexlify) via a parameter. Extending beyond what MicroPython already does in its binascii impl

[issue22385] Define a binary output formatting mini-language for *.hex()

2019-05-25 Thread Gregory P. Smith
Change by Gregory P. Smith : -- keywords: +patch pull_requests: +13486 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/13578 ___ Python tracker

[issue22385] Define a binary output formatting mini-language for *.hex()

2019-05-19 Thread Gregory P. Smith
Gregory P. Smith added the comment: FYI - micropython added an optional 'sep' second argument to binascii.hexlify() that is a single character separator to insert between every two hex digits. given the #9951 .hex() methods we have everywhere (and corresponding .fromhex), binascii.hexlify is

[issue22385] Define a binary output formatting mini-language for *.hex()

2017-05-03 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: -haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue22385] Define a binary output formatting mini-language for *.hex()

2017-05-03 Thread Nick Coghlan
Nick Coghlan added the comment: Re-using an existing minilanguage to mean something completely different wouldn't be a good idea. Whether or not we should add any bytes specific features for this at all is also still an open question, as one of the points raised in the latest python-ideas thr

[issue22385] Define a binary output formatting mini-language for *.hex()

2017-05-03 Thread Robert
Robert added the comment: regarding the proposal for mini format languages for bytes (msg292663): Wouldn't it be more consistent if the format specifiers are identical to the one of int's (see https://docs.python.org/3/library/string.html#format-specification-mini-language). I.e. "X" / "x" for

[issue22385] Define a binary output formatting mini-language for *.hex()

2017-05-01 Thread Nick Coghlan
Nick Coghlan added the comment: Minimalist proposal: def hex(self, *, bytes_per_group=None, delimiter=" "): """B.hex() -> string of hex digits B.hex(bytes_per_group=N) -> hex digits in groups separated by *delimeter* Create a string of hexadecimal numbers from a

[issue22385] Define a binary output formatting mini-language for *.hex()

2017-05-01 Thread Eric V. Smith
Eric V. Smith added the comment: The Unix "od" command pretty much has all of the possibilities covered. https://linuxconfig.org/od-1-manual-page Although "named characters" might be going a bit far. Float, too. -- ___ Python tracker

[issue22385] Define a binary output formatting mini-language for *.hex()

2017-05-01 Thread Gregory P. Smith
Gregory P. Smith added the comment: Based on the ideas thread it isn't obvious that chunk size means "per byte". I suggest either specifying the number of base digits per delimiter. Or using a name other than chunk that indicates it means bytes. If we're going to do this, it should also be d

[issue22385] Define a binary output formatting mini-language for *.hex()

2017-05-01 Thread Nick Coghlan
Nick Coghlan added the comment: Copying the amended proposal from that python-ideas thread into here: Start with a leading base format character (chosen to be orthogonal to the default format characters): "h": lowercase hex "H": uppercase hex "A": ASCII (using "." for unprintable &

[issue22385] Define a binary output formatting mini-language for *.hex()

2017-02-02 Thread Christian H
Changes by Christian H : -- nosy: +Christian H ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue22385] Define a binary output formatting mini-language for *.hex()

2015-06-03 Thread Chris Lasher
Changes by Chris Lasher : -- nosy: +gotgenes ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue22385] Define a binary output formatting mini-language for *.hex()

2015-05-11 Thread Nick Coghlan
Nick Coghlan added the comment: Reviewing the items I had flagged as dependencies of issue 22555 for personal tracking purposes, I suggest we defer further consideration of this idea to 3.6 after folks have had a chance to get some experience with the basic bytes.hex() method. -- vers

[issue22385] Define a binary output formatting mini-language for *.hex()

2014-09-23 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- nosy: +barry ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue22385] Define a binary output formatting mini-language for *.hex()

2014-09-19 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- nosy: +belopolsky ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue22385] Define a binary output formatting mini-language for *.hex()

2014-09-17 Thread Nick Coghlan
Nick Coghlan added the comment: python-ideas post with a sketch of a possible mini-language: https://mail.python.org/pipermail/python-ideas/2014-September/029352.html -- ___ Python tracker

[issue22385] Define a binary output formatting mini-language for *.hex()

2014-09-17 Thread Nick Coghlan
Nick Coghlan added the comment: Retitled the issue and made it depend on issue 9951. I now think it's better to tackle this more like strftime and have a method that accepts of particular custom formatting mini-language (in this case, the new hex() methods proposed in issue 9951), and then als