News for hackers. Stuff that matters.
Re:Ask HN: Why do you make class members private? by jstx1 on Monday July 25, 2022 @02:14PM (#32228572)
While we're on Python and private methods - what's with everyone just _underscoring every method and variable by default? Does anyone teach people to do this or have I just ran into a few people with this habit by chance?

I know what _underscoring does in Python and what PEP8 recommends but doing it all the time for everything is so ugly and unnecessary.

Re:Ask HN: Why do you make class members private? by ajoseps on Monday July 25, 2022 @02:22PM (#32228692)
I think it's because of what underscoring does. It's the "fake" privacy in Python. Also autocompleters tend to ignore those functions
Re:Ask HN: Why do you make class members private? by frenchy on Monday July 25, 2022 @02:34PM (#32228882)
Probably for the same reason that zero-based versioning (https://0ver.org/) is so popular. People want to avoid commitment.
Re:Ask HN: Why do you make class members private? by swinglock on Monday July 25, 2022 @02:31PM (#32228826)
Perhaps you worked with Java/C++ programmers using Python.