Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- With the class method when you put 'p self' person is defined as Person (the class) everywhere in the program
- Witht he instance method the class Person is not referred to everywhere. Just where it's called. It referrs to the specific
- instance of the class here it's Person.
- This from the bottom puts is shown first: "You'll see this as the class is being defined."
- then it puts "In this context, self is: "
- then "Person"
- then "See? self is the Person class." followed by:
- We're calling an example class method
- 'self' is always defined. What is 'self' here? Let's see.
- Person
- That was self!
- we're calling an example *instance* method
- 'self' is defined here, too, but see how it's an instance of the class."
- Which pretty much explains everything for now!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement