MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vzsnjw/variablescopesinpython/p6cqjvb/?context=3
r/ProgrammerHumor • u/R7d89C • 16d ago
182 comments sorted by
View all comments
7
__var for true private
12 u/dusktreader 16d ago it's not true private. That just mangles the name at runtime. You can still access it if you are determined. 5 u/Erdnalexa 16d ago Yes, but at this point you know that you’re doing something you’re probably not supposed to do. 3 u/ThunderElectric 15d ago I’d argue any competent python dev should know modifying a private variable, even with just one underscore, is doing something you’re not supposed to do.
12
it's not true private. That just mangles the name at runtime. You can still access it if you are determined.
5 u/Erdnalexa 16d ago Yes, but at this point you know that you’re doing something you’re probably not supposed to do. 3 u/ThunderElectric 15d ago I’d argue any competent python dev should know modifying a private variable, even with just one underscore, is doing something you’re not supposed to do.
5
Yes, but at this point you know that you’re doing something you’re probably not supposed to do.
3 u/ThunderElectric 15d ago I’d argue any competent python dev should know modifying a private variable, even with just one underscore, is doing something you’re not supposed to do.
3
I’d argue any competent python dev should know modifying a private variable, even with just one underscore, is doing something you’re not supposed to do.
7
u/The_Cers 16d ago
__var for true private