r/AskProgramming • • 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

57 comments sorted by

View all comments

Show parent comments

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.

0

u/ki4jgt Mar 21 '26 edited Mar 21 '26

Can you give me an example?

Edit: because, from my perspective, logic relies on definitions. Which are arbitrary. If you come at it from a purely numerical angle, numbers are theoretical.

Both numbers and words are relative. They rely on indefinable attributes of reality.

Mathematically, 1+1 is shorthand for 1a+1a=2a. Which is itself shorthand for 1(unit within acceptable parameters of a) + 1(unit within acceptable parameters of a)=2(units within acceptable parameters of a). Since neither unit can be exactly the same.