Re: [Python-Dev] Questions about signal handling.

2018-09-24 Thread Eric Snow
On Mon, Sep 24, 2018 at 3:10 PM Yury Selivanov wrote: > On Mon, Sep 24, 2018 at 4:19 PM Eric Snow wrote: > > This matters to me because I'd like to use "pending" calls for > > subinterpreters, which means dealing with signals *in* > > Py_MakePendingCalls() is problematic. Pulling the > >

Re: [Python-Dev] Questions about signal handling.

2018-09-24 Thread Yury Selivanov
On Mon, Sep 24, 2018 at 4:19 PM Eric Snow wrote: [..] > Is there a good place where this weirdness is documented? I'll need to look through uvloop & libuv commit log to remember that; will try to find time tonight/tomorrow. [..] > This matters to me because I'd like to use "pending" calls for >

Re: [Python-Dev] Questions about signal handling.

2018-09-24 Thread Eric Snow
On Mon, Sep 24, 2018 at 11:14 AM Yury Selivanov wrote: > On Fri, Sep 21, 2018 at 7:04 PM Eric Snow wrote: > > 1. Why do we restrict calls to signal.signal() to the main thread? > > 2. Why must signal handlers run in the main thread? > > 3. Why does signal handling operate via the "pending calls"

Re: [Python-Dev] Questions about signal handling.

2018-09-24 Thread eryk sun
On Fri, Sep 21, 2018 at 6:10 PM, Victor Stinner wrote: > > Moreover, you can get the signal while you don't hold the GIL :-) Note that, in Windows, SIGINT and SIGBREAK are implemented in the C runtime and linked to the corresponding console control events in a console application, such as

Re: [Python-Dev] Questions about signal handling.

2018-09-24 Thread Yury Selivanov
On Fri, Sep 21, 2018 at 7:04 PM Eric Snow wrote: > > Hi all, > > I've got a pretty good sense of how signal handling works in the > runtime (i.e. via a dance with the eval loop), but still have some > questions: > > 1. Why do we restrict calls to signal.signal() to the main thread? > 2. Why must

Re: [Python-Dev] Store startup modules as C structures for 20%+ startup speed improvement?

2018-09-24 Thread Franklin? Lee
On Fri, Sep 14, 2018 at 6:08 PM Larry Hastings wrote: > I can suggest that, based on conversation from Carl, that adding the stat > calls back in costs you half the startup. So any mechanism where we're > talking to the disk _at all_ simply isn't going to be as fast. Is that cost for when the

Re: [Python-Dev] Questions about signal handling.

2018-09-24 Thread Eric Snow
On Fri, Sep 21, 2018 at 5:11 PM Victor Stinner wrote: > Le sam. 22 sept. 2018 à 01:05, Eric Snow a > écrit : > > 3. Why does signal handling operate via the "pending calls" machinery > > and not distinctly? > > Signals can be received anytime, between two instructions at the > machine code

Re: [Python-Dev] Questions about signal handling.

2018-09-24 Thread Nick Coghlan
On Sat, 22 Sep 2018 at 09:14, Victor Stinner wrote: > > Le sam. 22 sept. 2018 à 01:05, Eric Snow a > écrit : > > 3. Why does signal handling operate via the "pending calls" machinery > > and not distinctly? > > Signals can be received anytime, between two instructions at the > machine code

Re: [Python-Dev] Postponed annotations break inspection of dataclasses

2018-09-24 Thread Raymond Hettinger
> On Sep 22, 2018, at 1:38 PM, Yury Selivanov wrote: > > On Sat, Sep 22, 2018 at 3:11 PM Guido van Rossum wrote: > [..] >> Still, I wonder if there's a tweak possible of the globals and locals used >> when exec()'ing the function definitions in dataclasses.py, so that >> get_type_hints()