Tagged articles
10 articles
Page 1 of 1
IT Services Circle
IT Services Circle
May 10, 2026 · Fundamentals

Why Does Python Use a Leading Underscore for Some Variables?

The article explains that a leading underscore in Python names signals a non‑public or internal use convention defined by PEP 8, describes its practical effects on imports and IDE hints, and outlines other underscore naming patterns such as name mangling, trailing underscores, magic methods, and throwaway variables.

PEP 8Pythonname mangling
0 likes · 6 min read
Why Does Python Use a Leading Underscore for Some Variables?
MaGe Linux Operations
MaGe Linux Operations
Sep 30, 2020 · Fundamentals

What Do Single and Double Underscores Really Mean in Python?

This article explains the five underscore naming patterns in Python—single leading, single trailing, double leading, double leading and trailing, and a solitary underscore—detailing their conventions, the name‑mangling mechanism, and how they affect class attributes and imports.

PEP 8Pythondunder
0 likes · 12 min read
What Do Single and Double Underscores Really Mean in Python?
MaGe Linux Operations
MaGe Linux Operations
Dec 25, 2018 · Fundamentals

What Do Single and Double Underscores Mean in Python? A Complete Guide

This article explains the five underscore naming patterns in Python—single leading, single trailing, double leading, double leading and trailing, and a solitary underscore—detailing their conventions, how name mangling works, and the impact on variable and method behavior with clear code examples.

PEP 8name manglingnaming conventions
0 likes · 12 min read
What Do Single and Double Underscores Mean in Python? A Complete Guide
MaGe Linux Operations
MaGe Linux Operations
Mar 14, 2017 · Fundamentals

Why Python’s Double Underscore Doesn’t Guarantee True Privacy

This article explains Python’s double‑underscore name‑mangling for private attributes, how they can still be accessed via class methods, the pitfalls of attribute shadowing, and why deleting dict entries may raise errors due to CPython’s underlying C implementation.

CPythonPythonattribute shadowing
0 likes · 4 min read
Why Python’s Double Underscore Doesn’t Guarantee True Privacy