Re: [Python-ideas] Add the imath module

2018-07-14 Thread Nick Coghlan
On 12 July 2018 at 23:41, Serhiy Storchaka wrote: > 12.07.18 16:15, Robert Vanden Eynde пише: >> >> About the name, why not intmath ? > > > Because cmath. But if most core developers prefer intmath, I have no > objections. My initial reaction from just the subject title was "But we already have

Re: [Python-ideas] The future of Python parallelism. The GIL. Subinterpreters. Actors.

2018-07-14 Thread Nick Coghlan
On 11 July 2018 at 00:31, David Foster wrote: > I was not aware of PyParallel. The PyParellel "parallel thread" > line-of-execution implementation is pretty interesting. Trent, big kudos to > you on that effort. > > Since you're speaking in the past tense and said "but we're not doing it > like

Re: [Python-ideas] Add the imath module

2018-07-14 Thread Steven D'Aprano
On Sat, Jul 14, 2018 at 03:39:25PM -0500, Tim Peters wrote: > While my code had no fluff at all. It's hard to believe you could add > enough cruft to slow it down by a factor of 1000, There's a factor of 20 because my computer is older and slower than yours. (I ran your version, and it was

Re: [Python-ideas] Add the imath module

2018-07-14 Thread Tim Peters
[Tim] > > Steven's numbers are pretty baffling to me, since these are all composite > > and so iterating Miller-Rabin "should get out" pretty fast: > [Steven] > That's because you haven't seen my code :-) > I'd be baffled anyway ;-) about 4.7 seconds to test 2**800 + 1; > I got 1.71 msec,

Re: [Python-ideas] The future of Python parallelism. The GIL. Subinterpreters. Actors.

2018-07-14 Thread Terry Reedy
On 7/14/2018 5:40 AM, Antoine Pitrou wrote: On Fri, 13 Jul 2018 18:22:24 -0600 Eric Snow wrote: 2. Give up on making things work inside the same OS process and rather focus on implementing better abstractions on top of the existing multiprocessing API so that the actor model is easier to

Re: [Python-ideas] Make import an expression

2018-07-14 Thread MRAB
On 2018-07-14 10:39, Jonathan Fine wrote: Hi Ken Thank you for your clear subject line. As you probably already know, in Python, assignments are not expressions, and so we can't write    if (a=get()):        # do something with a One reason for this is, perhaps, that "Explicit is better

Re: [Python-ideas] The future of Python parallelism. The GIL. Subinterpreters. Actors.

2018-07-14 Thread Eric Snow
On Sat, Jul 14, 2018 at 3:41 AM Antoine Pitrou wrote: > Davin has been mostly inactive. I'm the de facto maintainer for > multiprocessing. Ah, that's great to know. Sorry about the confusion. -eric ___ Python-ideas mailing list

Re: [Python-ideas] Make import an expression

2018-07-14 Thread Richard Damon
> On Jul 14, 2018, at 4:24 AM, Ken Hilton wrote: > > Hi all, > > Just a curious idea I had. The subject says it all. "import" is currently a > statement, which means it cannot be used inside anything else. Currently, the > only way to import a module inside an expression is to use the

Re: [Python-ideas] Make import an expression

2018-07-14 Thread Chris Angelico
On Sat, Jul 14, 2018 at 7:39 PM, Jonathan Fine wrote: > Hi Ken > > Thank you for your clear subject line. As you probably already know, in > Python, assignments are not expressions, and so we can't write >if (a=get()): ># do something with a > One reason for this is, perhaps, that

Re: [Python-ideas] The future of Python parallelism. The GIL. Subinterpreters. Actors.

2018-07-14 Thread Antoine Pitrou
On Fri, 13 Jul 2018 18:22:24 -0600 Eric Snow wrote: > > 2. Give up on making things work inside the same OS process and rather > > focus on implementing better abstractions on top of the existing > > multiprocessing API so that the actor model is easier to program > > against. For example,

Re: [Python-ideas] Make import an expression

2018-07-14 Thread Jonathan Fine
Hi Ken Thank you for your clear subject line. As you probably already know, in Python, assignments are not expressions, and so we can't write if (a=get()): # do something with a One reason for this is, perhaps, that "Explicit is better than implicit" (as in The Zen of Python, via

[Python-ideas] Make import an expression

2018-07-14 Thread Ken Hilton
Hi all, Just a curious idea I had. The subject says it all. "import" is currently a statement, which means it cannot be used inside anything else. Currently, the only way to import a module inside an expression is to use the __import__ function, which is both cumbersome and takes up more space

Re: [Python-ideas] Add the imath module

2018-07-14 Thread Steve Barnes
Looking for some information on how long it has taken to generate large primes I stumbled across https://arxiv.org/ftp/arxiv/papers/1709/1709.09963.pdf which makes interesting reading. It concentrates on giving no false negatives (never saying n is not a prime when it is) but giving an