some problems for an introductory python test

Chris Angelico rosuav at gmail.com
Tue Aug 10 00:18:13 EDT 2021


On Tue, Aug 10, 2021 at 1:41 PM Mats Wichmann <mats at wichmann.us> wrote:
>
>
> On 8/9/21 6:34 PM, Chris Angelico wrote:
>
> > If you want to highlight the OOP nature of Python, rather than looking
> > at magic methods, I'd first look at polymorphism. You can add a pair
> > of integers; you can add a pair of tuples; you can add a pair of
> > strings. Each one logically adds two things together and gives a
> > result, and they're all spelled the exact same way. Dunder methods are
> > a way for custom classes to slot into that same polymorphism, but the
> > polymorphism exists first and the dunders come later.
> >
> > ChrisA
> >
>
> not disagreeing... and yeah I could have thought deeper about the
> answer, but I still think "notthing has been OOP" -> "yes it has, they
> just didn't realize it"  was worth mentioning

Oh yes, absolutely agree.

ChrisA


More information about the Python-list mailing list