osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how to make super() work with externally defined methods in inheritance???


You really can't, and shouldn't. The super() helper relies on information
that exists inside the class definition and which is not available simply
at runtime by virtue of being attached to the class.

Besides, modifying classes externally is generally considered a bad idea.
Maybe you could accomplish this with a subclass adding this method, instead.

On Wed, Aug 15, 2018 at 4:04 PM, Paint-It-Black via Python-list <
python-list at python.org> wrote:

> > # this prints for me when I run this in 3.6
>
> excuse me, that is an extraneous comment from a cut and paste, in fact the
> example never makes it to the prints, as shown in the transcript just below
> the source code
> --
> https://mail.python.org/mailman/listinfo/python-list
>