Back to feed

Single and Double Underscores in Python Names

Real Python
Single and Double Underscores in Python Names

EDITOR BRIEF

The article explains Python naming conventions that use single and double underscores. These conventions can help design APIs, create safer classes, and avoid name clashes.

INSIGHTS

Understanding underscore conventions helps you write clearer, more predictable Python classes. Try using them in a small class and observe how the names behave.

CodeFriends courses that build on this story. Practice in the browser with nothing to install.

COMMENTS

0/40
0/2000

Loading comments…