So, I'm trying to create a little script here using OO to learn it, and I got some questions:
The script uses the Movie DB API, and I have a Series module. In this module I have 3 classes, 'Serie', 'Season' and 'Episode'. In __main__.py I will instantiate a serie like so 'some_random_name = Serie(123)', where 123 is the ID of the serie in the API. Serie class: title, year, length (X seasons), serieid and a function get_season(self, number) Season class: number, year, length (X episodes) and a function get_episode(self, number) Episode class: title, number, date and two functions, get_character(self, index) and crew_size() What would be the best approach using OO? Should I use class inheritance and how? What would be the best way to create the whole Serie instance with the least API calls possible? Remember that when I create a new Serie(serie_id) I create the whole thing, every season, every episode. Many thanks. PS: If you guys know a good book/course/tutorial about Python OO feel free to post it here. _______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
