r/learnpython • u/Forward-Ride2950 • 18d ago
Trying to understand Class, Object, Instance, and self in Python. Is my understanding correct?
I'm currently learning OOP in Python and wrote down some questions regarding object and instance for following code
=
= ```
1) is ?
:- is
2) is ?
:- is and is
3) ?
:- is in is and
pass
50
Upvotes
View all comments
1
u/2hands10fingers Experienced Pythonista 18d ago
Self is only something you can access if an object is instantiated, it’s a way to access and change the properties and methods as they’re currently stored within the object you’re referencing. You can create a class that never needs to be instantiated and only has methods that process external data without accessing itself.