DEV Community

Discussion on: A GENTLE INTRODUCTION TO PYTHON CLASSES FOR NEWBIES

Collapse
reritom profile image
Tomas Sheers

As a note, I'd say that the examples used could use some small adjustments.

A cake class wouldn't really have a method for preheating the oven. Same with pizzas not having methods for ordering pizzas.

A child class of a pizza would more likely be type of pizza like Margherita(Pizza). And then you could have a class like PizzaShop with the method order_pizza().

OrderPizza itself seems more like a function or a method of another class, than a class itself.

Collapse
oluchi profile image
Oluchi Orji Author

Thanks for your feedback, anyways all these are simple illustrations to help newbies come up with speed, anyways there is always a room for adjustment.