Re: [Python-ideas] A GUI for beginners and experts alike

2018-08-24 Thread Clément Pit-Claudel
Hi Mike, Thanks, this code is nice and short. Is adding 'if button is None: break' to the 'Read' version of your code the right way to make it exit when the main window is closed? (On my machine it enters an infinite loop after I close the main window). For comparison, I tried doing this

Re: [Python-ideas] PEP 505: None-aware operators

2018-07-22 Thread Clément Pit-Claudel
On 2018-07-22 08:10, Steven D'Aprano wrote: > Indeed. And I think we ought to think carefully about the benefits and > costs of all of those variants separately. > > To me, the ?? operator seems like a clear and obvious win. The other > variants are more complex and the benefit is not as

Re: [Python-ideas] Fwd: Trigonometry in degrees

2018-06-11 Thread Clément Pit-Claudel
On 2018-06-11 14:04, Stephan Houben wrote: > 2018-06-11 19:33 GMT+02:00 Michael Selik >: > > Whoops, it turns out Euler's formula does work! I expected imprecision, > but at least one test matched. > > x = 42 > cos(x) + 1j * sin(x) == e ** (1j * x) > > > I

Re: [Python-ideas] "any" and "all" support multiple arguments

2017-08-01 Thread Clément Pit-Claudel
On 2017-08-01 17:28, Nick Coghlan wrote: > Right, the main correspondence here is with "sum()": folks can't write > "sum(a, b, c)", but they can write "a + b + c". > > The various container constructors are also consistent in only taking > an iterable, with multiple explicit items being expected

Re: [Python-ideas] namedtuple literals [Was: RE a new namedtuple]

2017-07-20 Thread Clément Pit-Claudel
On 2017-07-20 11:30, Paul Moore wrote: > On 20 July 2017 at 10:15, Clément Pit-Claudel <cpitclau...@gmail.com> wrote: >> On 2017-07-20 11:02, Paul Moore wrote: >>>> Also, what's the advantage of (x=1, y=2) over ntuple(x=1, y=2)? I.e., >>>> why does this

Re: [Python-ideas] namedtuple literals [Was: RE a new namedtuple]

2017-07-20 Thread Clément Pit-Claudel
On 2017-07-20 11:02, Paul Moore wrote: >> Also, what's the advantage of (x=1, y=2) over ntuple(x=1, y=2)? I.e., >> why does this need to be syntax instead of a library? > > Agreed. Now that keyword argument dictionaries retain their order, > there's no need for new syntax here. In fact, that's one