I'd say NOT wanting to call an __init__ method of a superclass is a
rather uncommon occurence. It's generally a huge error. So I think
it's worth not accomodating that.

2018-05-28 9:27 GMT+02:00 Michael Lohmann <mial.lohm...@gmail.com>:
>
>>>    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?
>
> Sorry for that. Yes, it should have been Magic (I renamed the class after 
> writing it and didn’t pay attention). 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...
> _______________________________________________
> Python-ideas mailing list
> Python-ideas@python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to