dunder-docs (was Python is DOOMED! Again!)

Devin Jeanpierre jeanpierreda at gmail.com
Tue Feb 3 04:25:35 EST 2015


On Mon, Feb 2, 2015 at 6:20 AM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> Devin Jeanpierre wrote:
>> Oops, I just realized why such a claim might be made: the
>> documentation probably wants to be able to say that any method can use
>> super(). So that's why it claims that it isn't a method unless it's
>> defined inside a class body.
>
> You can use super anywhere, including outside of classes. The only thing you
> can't do is use the Python 3 "super hack" which automatically fills in the
> arguments to super if you don't supply them. That is compiler magic which
> truly does require the function to be defined inside a class body. But you
> can use super outside of classes:

Obviously, I was referring to no-arg super.

Please assume good faith and non-ignorance on my part.

-- Devin



More information about the Python-list mailing list