Re: [Python-ideas] Keyword for direct pass through of kwargs to super

2018-05-27 Thread Greg Ewing
Michael Lohmann wrote: class Magic: magic_number = 42 def __init__(self): A.magic_number = 0 # As soon as you look too deep into it all the Magic vanishes What is A here? Did you mean something else? -- Greg ___

Re: [Python-ideas] Proposal: A Reduce-Map Comprehension and a "last" builtin

2018-05-27 Thread Greg Ewing
Nick Coghlan wrote: Aye, while I still don't want comprehensions to implicitly create new locals in their parent scope, I've come around on the utility of letting inline assignment targets be implicitly nonlocal references to the nearest block scope. What if you're only intending to use it

Re: [Python-ideas] Keyword for direct pass through of kwargs to super

2018-05-27 Thread Michael Lohmann
> Everything my idea has to offer really is just reasonable if you don’t have > single inheritance only I would like to correct myself immediately on that one: In the Pizza-example (from yesterday as well) it would be possible to overwrite the default price of the HawaiianPizza with the

Re: [Python-ideas] Keyword for direct pass through of kwargs to super

2018-05-27 Thread Michael Lohmann
I realized that bypassing kwargs is probably the least important thing of this idea - so if implemented it definitely had to get a better name. Just look at the following example: class Magic: magic_number = 42 def __init__(self): A.magic_number = 0 # As soon as

Re: [Python-ideas] Keyword for direct pass through of kwargs to super

2018-05-27 Thread Greg Ewing
Brendan Barnwell wrote: If I understand correctly, the essence of your argument seems to be that you want be able to write a class A, and you want to be able to use that class EITHER as the top of an inheritance chain (i.e., have it inherit directly from object) OR in the middle of an

Re: [Python-ideas] Proposal: A Reduce-Map Comprehension and a "last" builtin

2018-05-27 Thread Nick Coghlan
On 26 May 2018 at 04:14, Tim Peters wrote: > [Peter O'Connor] > >> ... > >> We could use given for both the in-loop variable update and the variable > >> initialization: > >>smooth_signal = [average given average=(1-decay)*average + decay*x > >>

Re: [Python-ideas] Keyword for direct pass through of kwargs to super

2018-05-27 Thread Michael Lohmann
> If I understand correctly, the essence of your argument seems to be > that you want be able to write a class A, and you want to be able to use that > class EITHER as the top of an inheritance chain (i.e., have it inherit > directly from object) OR in the middle of an inheritance chain

Re: [Python-ideas] Keyword for direct pass through of kwargs to super

2018-05-27 Thread Brendan Barnwell
On 2018-05-26 02:22, Michael Lohmann wrote: Whenever you give any kwargs when directly instantiating `A` they will be passed down to super which in this case is `object`. And now to the follow-up question: Can you tell me which kwargs object takes as an input for it’s __init__? So does it EVER