logoalt Hacker News

ModernMechtoday at 1:37 PM1 replyview on HN

I dunno, as someone who doesn't program in Python, I find dunders to be very confusing. Like, how is this readable?

_foo

foo_

__foo

_Foo__bar

__foo__

foo__bar

All of that is valid Python, and some of those forms mean different things depending on where they are used.


Replies

seunosewatoday at 2:37 PM

What do you mean? Those are valid identifiers but programmers aren't required to use them.