Browse by Topic
Popular
Popular Posts
Latest
Latest Python Posts
Python Getter Setter: Using @property Correctly
Learn how Python implements getter and setter behavior with @property, when to use it, and how it differs from Java-style accessor methods.
Python Encapsulation: Name Mangling and Properties
Understand Python encapsulation through name mangling and properties, with practical code examples, comparison, and tradeoffs for production class design.
Python Private Variables: Name Mangling Explained
Learn how Python private variables work through name mangling, underscore conventions, and when each approach is useful for encapsulation.
Python Private Methods: Naming Conventions and Name Mangling
Python private methods are a naming convention, not enforced privacy. See how single and double underscores, name mangling, and inheritance affect class design.
Python Double Underscore Name Mangling Explained
Learn how Python's double underscore name mangling rewrites attribute names inside classes, why the rule exists, and when to use it.
Python Name Mangling: How Double Underscores Work
Learn how Python name mangling rewrites double-underscore attributes, why it prevents subclass collisions, and when a single underscore is the better choice.
Python Private Attributes: Syntax and Limits
Understand how Python private attributes work through name mangling, why they aren't truly private, and when to use them for maintainable code.
Python Protected Attribute: Conventions and Pitfalls
Learn why Python's single underscore indicates a protected attribute by convention, how double underscore name mangling works, and when to use properties.
Python Public Attribute: Definition and Access Control
Understand Python public attributes, naming conventions, and how to use properties to control attribute access in your classes.
Python Access Modifiers: How Encapsulation Really Works
python access modifiers: Learn how Python implements access control through underscore conventions, name mangling, and properties—and when each approach is appropriate.