OOP in Python #6 - @Property Decorator: Getters, Setters and Deleters

preview_player
Показать описание
Hello everyone! In this video, I explain how you can use the property decorator to implement getters, setters and deleters into your classes. This is extremely useful when working with protected attributes, since it allows you to access and modify data indirectly but without changing the syntax. Thank you for watching and have fun coding!

Timestamps:

00:00 - Public vs protected attributes
01:54 - Why use the @property decorator?
02:24 - Creating getters setters and deleters

*Hashtags*

#robotmaze
#objectorientedprogramming
#programming
#python
Рекомендации по теме
Комментарии
Автор

In line with best practices, I would caution against using "Students" (plural) as the class name, as it sounds like a class that would hold info on multiple students. Whereas the code you're writing is clearly the information of one student at a time.

Yakushii