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

2017-05-01 Thread Terry Reedy
On 5/1/2017 1:41 PM, Alexandre Brault wrote: On 2017-05-01 01:34 PM, Ethan Furman wrote: On 05/01/2017 07:04 AM, Juancarlo Añez wrote: On Mon, May 1, 2017 at 9:38 AM, Nick Coghlan wrote: just support two keyword arguments to hex(): "delimiter" (as you suggest) and "chunk_size" (defaulting to

Re: [Python-ideas] Augmented assignment syntax for objects.

2017-05-01 Thread Jerry Hill
On Thu, Apr 27, 2017 at 7:21 PM, Steven D'Aprano wrote: > On Wed, Apr 26, 2017 at 03:54:22PM -0400, Jerry Hill wrote: >> On Tue, Apr 25, 2017 at 8:05 PM, Ryan Gonzalez wrote: >> > def ___init__(self, self.attr): >> >> I'm not a python developer, I'm just a

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

2017-05-01 Thread Alexandre Brault
On 2017-05-01 01:41 PM, Alexandre Brault wrote: > On 2017-05-01 01:34 PM, Ethan Furman wrote: >> On 05/01/2017 07:04 AM, Juancarlo Añez wrote: >>> On Mon, May 1, 2017 at 9:38 AM, Nick Coghlan wrote: >>> just support two keyword arguments to hex(): "delimiter" (as you suggest) and

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

2017-05-01 Thread Alexandre Brault
On 2017-05-01 01:34 PM, Ethan Furman wrote: > On 05/01/2017 07:04 AM, Juancarlo Añez wrote: >> On Mon, May 1, 2017 at 9:38 AM, Nick Coghlan wrote: >> >>> just support two >>> keyword arguments to hex(): "delimiter" (as you suggest) and >>> "chunk_size" (defaulting to 1, so you get per-byte

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

2017-05-01 Thread Ethan Furman
On 05/01/2017 07:04 AM, Juancarlo Añez wrote: On Mon, May 1, 2017 at 9:38 AM, Nick Coghlan 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

Re: [Python-ideas] Proposed PEP 484 addition: describe a way of annotating decorated declarations

2017-05-01 Thread Guido van Rossum
On Mon, May 1, 2017 at 12:28 AM, Nick Coghlan wrote: > On 1 May 2017 at 03:07, Guido van Rossum wrote: > > There's a PR to the peps proposal here: > > https://github.com/python/peps/pull/242 > > > > The full text of the current proposal is below. The

Re: [Python-ideas] Decorators for running a function in a Process or Thread

2017-05-01 Thread Nick Coghlan
On 1 May 2017 at 22:02, Paul Moore wrote: > On 1 May 2017 at 12:13, NoxDaFox wrote: >> >> I think it could be a good fit for the `concurrent.futures` module. >> Decorated functions would return a `Future` object and run the logic in a >> separate thread

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

2017-05-01 Thread Nick Coghlan
On 1 May 2017 at 17:19, wrote: > The bytes.hex() function is the inverse function of Bytes.fromhex(). > > But fromhex can process spaces (which is much more readable), while hex() > provides no way to include spaces. > > My proposal would be to add an optional delimiter,

Re: [Python-ideas] Augmented assignment syntax for objects.

2017-05-01 Thread Juancarlo Añez
On Thu, Apr 27, 2017 at 7:28 PM, Steven D'Aprano wrote: > > In my experience, what Python is lacking is a way to declare attributes > > outside of the constructor. Take a look at how it's done in C#, Swisft, > or > > Go. > > Since you apparently already know how they do it,

Re: [Python-ideas] Decorators for running a function in a Process or Thread

2017-05-01 Thread Paul Moore
On 1 May 2017 at 12:13, NoxDaFox wrote: > > I think it could be a good fit for the `concurrent.futures` module. > Decorated functions would return a `Future` object and run the logic in a > separate thread or process. > > > @concurrent.futures.thread > def function(arg,

[Python-ideas] Decorators for running a function in a Process or Thread

2017-05-01 Thread NoxDaFox
The decorators would abstract the logic of spawning a process or thread and maintaining its lifecycle. I think it could be a good fit for the `concurrent.futures` module. Decorated functions would return a `Future` object and run the logic in a separate thread or process.

Re: [Python-ideas] Proposed PEP 484 addition: describe a way of annotating decorated declarations

2017-05-01 Thread Nick Coghlan
On 1 May 2017 at 03:07, Guido van Rossum wrote: > There's a PR to the peps proposal here: > https://github.com/python/peps/pull/242 > > The full text of the current proposal is below. The motivation for this is > that for complex decorators, even if the type checker can figure

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

2017-05-01 Thread robert.hoelzl
The bytes.hex() function is the inverse function of Bytes.fromhex(). But fromhex can process spaces (which is much more readable), while hex() provides no way to include spaces. My proposal would be to add an optional delimiter, that allows to specify a string that will be inserted between the