Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Also, I recently learned that only leading __ are considered special, whereas both sets of __ go back to being a public method due to the dunder magic methods such as __add__, __eq__, etc


Oh yeah, I didn’t even notice. Much worse than I thought!

Imagine explaining these rules to a beginner learning programming.


It should be mentioned that within the python community using __ for extra private is widely seen as a misfeature that shouldn't've been added and shouldn't be used.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: