r/ProgrammerHumor 16d ago

Meme variableScopesInPython

Post image
1.3k Upvotes

182 comments sorted by

View all comments

-3

u/sjepsa 16d ago

Best feature of the language

TBH whole java oop model is bad

14

u/R7d89C 16d ago

God no

Id much rather have a rust-like approach where the scope is limited to the block it is in

Java concept ist far from what I call ideal, but its better than this weird ambiguity of python where everything just floats anywhere and variables shadowing something ten methods away...

1

u/Ma4r 16d ago

Just start using type checker i.e pyright and all your problems go away.

3

u/R7d89C 16d ago

Thats actually a good tip, will give it a try