some problems for an introductory python test

Mats Wichmann mats at wichmann.us
Mon Aug 9 23:39:37 EDT 2021


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


More information about the Python-list mailing list