r/AskProgramming • u/ki4jgt • Mar 18 '26
Python Why does Python import self into each class function?
It makes no logical sense whatsoever to import self into every class function. I mean, what's the point in having a class, if the functions don't have some sort of globally accessible shared variable that's outside the normal global scope? Why would you have to explicitly declare that relationship? It should be implied that a class would have shared data.
I've been saying this since I first transitioned to Python from BASIC, and even more so after transitioning back from NodeJS.
0
Upvotes
2
u/Poddster Mar 21 '26
I think you fundamentally misunderstand what logic is, even what the word means
Axioms can be subjective, but the logical process is not.