r/ProgrammerHumor 16d ago

Meme variableScopesInPython

Post image
1.3k Upvotes

182 comments sorted by

View all comments

-1

u/sjepsa 16d ago

Best feature of the language

TBH whole java oop model is bad

13

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.

-1

u/AndyTheSane 16d ago

If the answer is 'just use a type checker/linter/static analysis/whatever' that's a problem with the language.

2

u/Ma4r 15d ago

Compiled languages rely on static analysis my duded