Do PRIVATE variables EXIST in Python classes?

Опубликовано: 30 Январь 2023
на канале: Coders Bring Change (Python for Everyone)
605
24

Many Python tutorials speak of private variables. But can a dynamic language like Python even have private variables? The answer is no. There is no way to protect class attributes from being access from the outside. In this video you see why the visibility of all properties is public in Python.

C H A P T E R S
0:11 How people use underscores and call them private
0:26 How you think you can do it and why it is impossible (examples)
2:45 Double underscores are for name mangling and has another purpose
3:08 Single underscore is a convention

M Y O N L I N E T R A I N I N G
🎓Like my style of teaching? Try free chapters of my online courses: https://pythonforeveryone.com

L I N K S I N T H E V I D E O
Python private variables documentation: https://docs.python.org/3/tutorial/cl...

#private #public #python


На этой странице сайта вы можете посмотреть видео онлайн Do PRIVATE variables EXIST in Python classes? длительностью 16 минут 40 секунд в хорошем качестве, которое загрузил пользователь Coders Bring Change (Python for Everyone) 30 Январь 2023, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 605 раз и оно понравилось 24 зрителям. Приятного просмотра!