Lec 16 | MIT 6.00 Introduction to Computer Science and Programming, Fall 2008

Sdílet
Vložit
  • čas přidán 18. 08. 2009
  • Lecture 16: Encapsulation, inheritance, shadowing
    Instructors: Prof. Eric Grimson, Prof. John Guttag
    View the complete course at: ocw.mit.edu/6-00F08
    License: Creative Commons BY-NC-SA
    More information at ocw.mit.edu/terms
    More courses at ocw.mit.edu

Komentáře • 20

  • @kuanxD
    @kuanxD Před 4 lety +5

    now on Python 3 you can data hide

  • @abubakarrmkamara9884
    @abubakarrmkamara9884 Před 7 lety

    I appreciate a lot for this knowledge base electronic lecture.

  • @romangeneral23
    @romangeneral23 Před 13 lety

    I love these videos

  • @leonjones7120
    @leonjones7120 Před 3 lety

    Making more progress with these few lectures in a shorter time than when I did my degree and bombed in this topic. Had to change courses!

  • @Ganurao
    @Ganurao Před 12 lety

    Thank you MIT.

  • @justinej.clarke111
    @justinej.clarke111 Před 8 lety +1

    Awesome, this is interesting.

  • @arantebw
    @arantebw Před 8 lety +1

    MIT OpenCourseWare, thank you!

  • @chaitanyaraut5672
    @chaitanyaraut5672 Před 6 lety +3

    Prof. Eric has a great sense of humor. I think he could be an equally amazing stand up comedian!!

  • @tkearn5000
    @tkearn5000 Před 14 lety

    For anyone who's been following the assignments, what did you use as the key for your dictionary on the DP part of the last problem set, ps8? My answer matched with the example for W = 30 and it ran fairly fast, but I had to use a tuple of four variables to get a workable key. Anyone have a better solution?

  • @mrProgrammingGeek
    @mrProgrammingGeek Před 14 lety +3

    beautiful examples!
    python is pretty!

  • @jishnumohan
    @jishnumohan Před 12 lety

    @NicolPotent actually its 'nailed that pset'

  • @ywk7282
    @ywk7282 Před 6 lety +1

    Can any one discern what it says up arrow above PER box

    • @eveninrose
      @eveninrose Před 6 lety +1

      김윤우 I was confused too at first, but around 8:32 he clarifies it is an "is-a" link, which denotes that per (self) 'is a' Person

  • @OrakzaiSays
    @OrakzaiSays Před 5 lety +1

    Underbar sounds kinda weird

  • @annaz1652
    @annaz1652 Před 9 lety

    What did he mean by it's not symmetric at 32:04? Why wouldn't it compare first/last names because an UG is an MIT Person that is a Person which has first/last names?

    • @ywk7282
      @ywk7282 Před 6 lety

      Anna Z i think its because it comparing id num but it doesnt exist

    • @eveninrose
      @eveninrose Před 6 lety +2

      2 years late, but I think he means the inheritance differs by the self or implicit object. ug.__cmp__(per) is calling its compare method on ug, with per as the argument, so the compare that ug is using is inherited from its parent class MITPerson (comparing ids) and it doesn't go all the way back to the cmp method in Person.
      Whereas the second example the order is reversed, so the call is per.__cmp__(ug), with per using the compare method accessible to it, directly from Person (checking first name, last name), with ug passed as the argument instead.

  • @brainstormingsharing1309
    @brainstormingsharing1309 Před 3 lety +1

    👍👍👍👍👍👍👍👍👍

  • @eliotball
    @eliotball Před 14 lety

    In c# it is so easy because you have public, protected and private. Python's lacking of this is very bad.