Advertisement
Guest User

Untitled

a guest
May 31st, 2016
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. With the class method when you put 'p self' person is defined as Person (the class) everywhere in the program
  2. Witht he instance method the class Person is not referred to everywhere. Just where it's called. It referrs to the specific
  3. instance of the class here it's Person.
  4.  
  5. This from the bottom puts is shown first: "You'll see this as the class is being defined."
  6. then it puts "In this context, self is: "
  7. then "Person"
  8. then "See? self is the Person class." followed by:
  9. We're calling an example class method
  10. 'self' is always defined. What is 'self' here? Let's see.
  11. Person
  12. That was self!
  13. we're calling an example *instance* method
  14. 'self' is defined here, too, but see how it's an instance of the class."
  15. Which pretty much explains everything for now!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement