Re: [Python-ideas] Provide a way to import module without exec body

2017-12-02 Thread Serhiy Storchaka
01.12.17 20:12, Neil Schemenauer пише: On 2017-12-01, Chris Angelico wrote: Can you elaborate on where this is useful, please? Introspection tools, for example, might want to look at the module without executing it. Also, it is a building block to make lazy loading of modules work. As Nick

Re: [Python-ideas] Provide a way to import module without exec body

2017-12-02 Thread Neil Schemenauer
On 2017-12-03, Nick Coghlan wrote: > There'd be some subtleties around handling backwards compatibility > with __import__ overrides (essentially, CREATE_MODULE would have to > revert to doing all the work, while EXEC_MODULE would become a no-op), > but the basic idea seems plausible. Right now

Re: [Python-ideas] Provide a way to import module without exec body

2017-12-02 Thread Nick Coghlan
On 3 December 2017 at 13:22, Nick Coghlan wrote: > On 2 December 2017 at 07:55, Brett Cannon wrote: >> As for the completely separating the loading and execution, I don't have a >> need for what's being proposed so I don't have an opinion. I basically made

Re: [Python-ideas] Provide a way to import module without exec body

2017-12-02 Thread Nick Coghlan
On 2 December 2017 at 07:55, Brett Cannon wrote: > As for the completely separating the loading and execution, I don't have a > need for what's being proposed so I don't have an opinion. I basically made > sure Eric Snow structured specs so that lazy loading as currently

Re: [Python-ideas] PEP 505 vs matrix multiplication

2017-12-02 Thread Nick Coghlan
On 2 December 2017 at 00:16, Paul Moore wrote: > At the moment, 99% of the discussion seems rooted in generalised "it > would help a lot of code" with readability arguments based on > artificial examples, and that's not really helping move the discussion > forward. PEP 505

Re: [Python-ideas] PEP 447: Adding type.__getdescriptor__

2017-12-02 Thread Nick Coghlan
On 2 December 2017 at 01:12, Ronald Oussoren wrote: > On 1 Dec 2017, at 12:29, Nick Coghlan wrote: >> 2. Define it as a class method, but have the convention be for the >> *caller* to worry about walking the MRO, and hence advise class >> implementors

Re: [Python-ideas] How assignment should work with generators?

2017-12-02 Thread Greg Ewing
C Anthony Risinger wrote: * Unpacking is destructuring not pattern matching. We're just arguing about the definition of terms now. The point I was making is that unpacking is fundamentally a declarative construct, or at least that's how I think about it. I used the term "pattern matching"