[Python-ideas] Add an option for delimiters in bytes.hex()

Carl Smith carl.input at gmail.com
Tue May 2 08:18:01 EDT 2017


On the block size arg, couldn't it just be named `index`?

On Tue, 2 May 2017 13:12 Carl Smith, <carl.input at gmail.com> wrote:

> Sorry. I meant to be terse, but wasn't clear enough. I meant the method
> name. If it takes a `delimiter` karg, it would be consistent to call the
> operation `delimit`.
>
> On Tue, 2 May 2017 13:06 Carl Smith, <carl.input at gmail.com> wrote:
>
>> Couldn't it just be named `str.delimit`? I totally agree with Steve for
>> what it's worth. Thanks for everything guys. Best,
>>
>> On Tue, 2 May 2017 13:02 Joao S. O. Bueno, <jsbueno at python.org.br> wrote:
>>
>>> On 1 May 2017 at 11:04, Juancarlo Añez <apalala at gmail.com> wrote:
>>> >
>>> > On Mon, May 1, 2017 at 9:38 AM, Nick Coghlan <ncoghlan at gmail.com>
>>> wrote:
>>> >>
>>> >> just support two
>>> >> keyword arguments to hex(): "delimiter" (as you suggest) and
>>> >> "chunk_size" (defaulting to 1, so you get per-byte chunking by
>>> >> default)
>>> >
>>> >
>>> > I'd expect "chunk_size"  to mean the number of hex digits (not bytes)
>>> per
>>> > chunk.
>>> So do I. Moreover, if "1" is for two digits, there is no way to
>>> specify single digits - for little use we can perceive for that.
>>>
>>> Maybe it does not need to be named "chunk_size" - "digits_per_block"
>>> is too big, but is precise.
>>>
>>> Also, whatever we think is good for "hex" could also be done to "bin" .
>>>
>>> >
>>> > Cheers,
>>> >
>>> >
>>> > --
>>> > Juancarlo Añez
>>> >
>>> > _______________________________________________
>>> > Python-ideas mailing list
>>> > Python-ideas at python.org
>>> > https://mail.python.org/mailman/listinfo/python-ideas
>>> > Code of Conduct: http://python.org/psf/codeofconduct/
>>> >
>>> _______________________________________________
>>> Python-ideas mailing list
>>> Python-ideas at python.org
>>> https://mail.python.org/mailman/listinfo/python-ideas
>>> Code of Conduct: http://python.org/psf/codeofconduct/
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20170502/df53a7a8/attachment.html>


More information about the Python-ideas mailing list