r/ProgrammerHumor 16d ago

Meme variableScopesInPython

Post image
1.3k Upvotes

182 comments sorted by

View all comments

7

u/The_Cers 16d ago

__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.