Python abstract base classes, difference between mixin and abstract method

The following table shows the various abstract base classes that are used throughout python. However, I'm a little confused (in this context)

what is the difference between column Abstract Methodsand column Mixin Methods. Is one option possible and the other not?

I considered this, and each of my "theories" seems to be wrong.

link


enter image description here

+4
source share
2 answers

Everything in the Abstract Methods column, you have to realize yourself. ABC provides standard method implementations in the Mixin Methods column, implemented as methods that you must write.

+6

- , , ABC.

Mixin , , , object, ABC. __getitem__, __iter__ , .

, , , issubclass(your_class, any_ABC), - isinstance(your_object, any_ABC). .

+2

All Articles