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

Greg Ewing greg.ewing at canterbury.ac.nz
Mon May 28 19:53:49 EDT 2018


Michael Lohmann wrote:
> I just wanted to override the
> class-variable `magic_number` to give a reason why I don’t ever want to call
> Magic.__init__ in Foo. If you want, you can have this class instead:
> 
> class Magic:
 >     def __init__(self): raise RuntimeError("Do not initialize this
>         class")
 >
> but I figured that this might look a bit artificial...

But your original example looks just as artificial. Skipping
the initialisation of a class you're inheriting from is an
extremely weird thing to do, and in any real-life situation
there's almost certainly a better design.

In any case, I don't see how this has anything to do with
invisible passing of **kwds.

In short, I don't understand what you're saying at all.

-- 
Greg


More information about the Python-ideas mailing list