How does python handle object oriented constructs such as abstract, virtual, pure virtual etc
Examples and links would really be good.
An abstract method is one that (in the base class) raises NotImplementedError
.
An abstract class, like in C++, is any class that has one or more abstract methods.
All methods in Python are virtual (i.e., all can be overridden by subclasses).
A "pure virtual" method would presumably be the same thing as an abstract one.
In each case you could attempt deep black magic to fight against the language, but it would be (generally speaking) exceedingly silly to do so.
I've striven to deal with the "etc" part in two books, a dozen videos, two dozen essays and PDFs and other presentations, and I can't spend the next few days summarizing it all here. Ask specific questions, and I'll be glad to try and answer!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With