Name Mangling Python

Опубликовано: 06 Октябрь 2025
на канале: Kenny Yip Coding
2,791
80

Data hiding with private fields/methods using name mangling in Python. In Python, there is no true dating hiding with private fields/methods; however you can replicate the behavior using name mangling. Name mangling causes the attribute with double underscores to become ClassName_ attribute internally within Python. Therefore, you can still access these methods by accessing the fields/methods via ClassName_ attribute.

Source Code:
https://github.com/ImKennyYip/python-oop

Python Object Oriented Programming Playlist:
   • Python Object Oriented Programming  

Python Data Structures and Algorithms Playlist:
   • Python Data Structures and Algorithms  

Python Game Programming Projects Playlist:
   • Python Game Programming Tutorials  

Subscribe for more coding tutorials 😄!

⭐ If you enjoyed the tutorial and would like to support the channel, you can do so here 💖: https://buymeacoffee.com/kennyyipcoding