Encapsulation with 'Setter' and 'Getter' methods in Classes | Python

preview_player
Показать описание
#Classes #Encapsulation #Python #Setter #Getter

To avoid direct access of a class field i.e. private variables cannot be accessed directly or modified by external user, setter and getter methods are used.

Here I demonstrate a basic example of this.

Next time we'll look at @property decorators...(nothing to do with Dulux or dust sheets).

Check out the Minimalist online python IDE :

Рекомендации по теме
Комментарии
Автор

Hey Dr Pi
I enjoy watching how damn good your speaking skills become. The practice does all the magic, awesome (I remember Urban Dictionary description for this word btw))) ).


re: gaining subscribers and general channel direction
- you're rising quite an interesting topic to think of, you know when I started my channel it was about C programming, chess engines and BF interpreters and it had for about 40 subscribers for more then half a year. Then I started my freelancing career and making videos on web development - gave me estimate 70 subscribers more and then I started show in my videos what I actually do on my daily freelance projects and that gave me 100+ subscribers in less then 2 month (and of course your tips on how to formulate video description definitely helped, I got 10 subs only for yesterday). Eventually people started to say in the commentaries that my channel is ALL about web scraping believe it or not. And I thought like ok if web scraping is really what you like I'll be happy covering it all along the way. I'm telling this just to motivate you even more - what you did regarding Raspberry Pi is great, but as was already mentioned it's not that popular as python. So as far as we're creating this content for people it's totally fine to follow their requests.


re: github
- really good. I think it might be a good idea to create a video on GIT utility, i mean thinks like how to create new repo, clone, push, pull - somewhat a very basics. Git is oftent considered to be a requested skill on freelance jobs if clients want you to host the code on their own git-based services, e.g. gitlab (commercial github clone for businesses)


And one last thing. Well, it's definitelly not my business, but I think it would be nice if you'll use light color scheme for the videos, for it's more casual and user friendly IMO (I understand that PROs prefer dark schemes for numerous points, but light scheme seems to be more "educationally focused" IMO again, btw I switched to light color scheme in my daily job after starting using it in my videos). Another thing to consider is not to show the parts of your desktop that doesn't relate to the video topic, i mean just the full screen editor and use Alt-Tab to switch to console is ok, OR have both editor and console, OR use some IDE like Visual Studio Code OR use command line editor like Micro (Like Nano but MUCH more powerful, it's like GUI editors with standard short key bindings). So the environment matters.

monkey_see_monkey_do